-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1765: use vt compilation flags for bundled libraries as well #1776
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bb3b323
#1765: use vt compilation flags for bundled libraries
cz4rs 08ecf95
#1765: remove obsolete CLI11 flag
cz4rs eb2ee29
#1765: do not set compilation flags for header-only libraries
cz4rs 6a9bcd6
#1765: only enable sanitizers for vt target
cz4rs 25348a1
#1765: CMake: remove obsolete code
cz4rs 8164b4d
#1765: CMake: set diagnostic related flags from single file
cz4rs 48b4117
#1765: CMake: make `set_darma_compiler_flags` a function
cz4rs f103b7b
#1765: CMake: avoid redundant variables
cz4rs cbca813
#1765: CMake: set compilation flags when loading libraries
cz4rs 54bd0fd
#1765: bump required CMake version in bundled libraries
cz4rs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,34 @@ | ||
# Call this from all CMakeLists.txt files that can be built independently. | ||
|
||
macro(set_darma_compiler_flags vt_target) | ||
|
||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") | ||
# 4.9.3 complains about std::min not being constexpr | ||
if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5)) | ||
message("${PROJECT_NAME} currently requires g++ 5 or greater. If you need it to work with 4.9, please complain.") | ||
endif () | ||
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -ftemplate-depth=900) | ||
if (APPLE) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -stdlib=libc++ -DCLI11_EXPERIMENTAL_OPTIONAL=0) | ||
function(set_darma_compiler_flags vt_target) | ||
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") | ||
# 4.9.3 complains about std::min not being constexpr | ||
if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5)) | ||
message("${PROJECT_NAME} currently requires g++ 5 or greater. If you need it to work with 4.9, please complain.") | ||
endif () | ||
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -ftemplate-depth=900) | ||
if (APPLE) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -stdlib=libc++) | ||
endif () | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021.3.0) | ||
list(APPEND TARGET_PRIVATE_CXX_FLAGS -fhonor-infinites -fhonor-nans) | ||
elseif (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Intel") | ||
message(FATAL_ERROR "Your C++ compiler may not support C++14.") | ||
endif () | ||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -DCLI11_EXPERIMENTAL_OPTIONAL=0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed: |
||
endif() | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021.3.0) | ||
list(APPEND TARGET_PRIVATE_CXX_FLAGS -fhonor-infinites -fhonor-nans) | ||
elseif (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Intel") | ||
message(FATAL_ERROR "Your C++ compiler may not support C++14.") | ||
endif () | ||
|
||
if (vt_asan_enabled) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls) | ||
endif() | ||
|
||
if (vt_ubsan_enabled) | ||
add_definitions(-DVT_UBSAN_ENABLED) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -fsanitize=undefined -fno-omit-frame-pointer) | ||
endif() | ||
if ("${vt_target}" STREQUAL "${VIRTUAL_TRANSPORT_LIBRARY}") | ||
if (vt_asan_enabled) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls) | ||
endif() | ||
|
||
message(DEBUG "Target ${vt_target} public compile options: ${TARGET_CXX_FLAGS}") | ||
target_compile_options(${vt_target} PUBLIC ${TARGET_PUBLIC_CXX_FLAGS}) | ||
if (vt_ubsan_enabled) | ||
add_definitions(-DVT_UBSAN_ENABLED) | ||
list(APPEND TARGET_PUBLIC_CXX_FLAGS -fsanitize=undefined -fno-omit-frame-pointer) | ||
endif() | ||
endif() | ||
|
||
message(DEBUG "Target ${vt_target} private compile options: ${TARGET_CXX_FLAGS}") | ||
target_compile_options(${vt_target} PRIVATE ${TARGET_PRIVATE_CXX_FLAGS}) | ||
message(DEBUG "Target ${vt_target} public compile options: ${TARGET_PUBLIC_CXX_FLAGS}") | ||
target_compile_options(${vt_target} PUBLIC ${TARGET_PUBLIC_CXX_FLAGS}) | ||
|
||
endmacro() | ||
message(DEBUG "Target ${vt_target} private compile options: ${TARGET_PRIVATE_CXX_FLAGS}") | ||
target_compile_options(${vt_target} PRIVATE ${TARGET_PRIVATE_CXX_FLAGS}) | ||
endfunction() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed:
CMAKE_CXX_EXTENSIONS
is already disabled in the mainCMakeLists.txt