Skip to content

Commit

Permalink
Set cxx extensions and std required flags per target
Browse files Browse the repository at this point in the history
  • Loading branch information
benvenutti committed Aug 25, 2024
1 parent f23fa40 commit 45d6794
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release FORCE)
endif()

set(CXX_STANDARD_REQUIRED ON)
set(CXX_EXTENSIONS OFF)

# testing:

if(BUILD_TESTS)
Expand Down
8 changes: 7 additions & 1 deletion app-qtwidget/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ qt_add_executable(

target_compile_features(core8-gui-qtwidget PUBLIC cxx_std_20)

set_target_properties(core8-gui-qtwidget PROPERTIES COMPILE_WARNING_AS_ERROR ON)
set_target_properties(
core8-gui-qtwidget
PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
COMPILE_WARNING_AS_ERROR ON
)

target_link_libraries(
core8-gui-qtwidget
Expand Down
8 changes: 7 additions & 1 deletion model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ add_library(

target_compile_features(core8-model PUBLIC cxx_std_20)

set_target_properties(core8-model PROPERTIES COMPILE_WARNING_AS_ERROR ON)
set_target_properties(
core8-model
PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
COMPILE_WARNING_AS_ERROR ON
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/model/Version.hpp.in
Expand Down
8 changes: 7 additions & 1 deletion model/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ add_executable(

target_compile_features(model_tests PUBLIC cxx_std_20)

set_target_properties(model_tests PROPERTIES COMPILE_WARNING_AS_ERROR ON)
set_target_properties(
model_tests
PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
COMPILE_WARNING_AS_ERROR ON
)

target_link_libraries(model_tests PRIVATE core8-model Catch2::Catch2WithMain)

Expand Down

0 comments on commit 45d6794

Please sign in to comment.