-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1776 from DARMA-tasking/1765-common-compilation-f…
…lags 1765: use vt compilation flags for bundled libraries as well
- Loading branch information
Showing
9 changed files
with
53 additions
and
89 deletions.
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) | ||
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