| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | function(thrust_build_compiler_targets) |
| | set(cxx_compile_definitions) |
| | set(cxx_compile_options) |
| |
|
| | thrust_update_system_found_flags() |
| |
|
| | if (THRUST_TBB_FOUND) |
| | |
| | |
| | append_option_if_available("-Wno-unused-parameter" cxx_compile_options) |
| | endif() |
| |
|
| | if ("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | |
| | append_option_if_available("/W3" cxx_compile_options) |
| |
|
| | |
| | append_option_if_available("/WX" cxx_compile_options) |
| |
|
| | |
| | |
| | append_option_if_available("/wd4244" cxx_compile_options) |
| | append_option_if_available("/wd4267" cxx_compile_options) |
| |
|
| | |
| | |
| | append_option_if_available("/wd4800" cxx_compile_options) |
| |
|
| | |
| | append_option_if_available("/wd4146" cxx_compile_options) |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | append_option_if_available("/wd4494" cxx_compile_options) |
| |
|
| | |
| | |
| | append_option_if_available("/bigobj" cxx_compile_options) |
| |
|
| | |
| | list(APPEND cxx_compile_definitions "NOMINMAX") |
| | else() |
| | append_option_if_available("-Werror" cxx_compile_options) |
| | append_option_if_available("-Wall" cxx_compile_options) |
| | append_option_if_available("-Wextra" cxx_compile_options) |
| | append_option_if_available("-Winit-self" cxx_compile_options) |
| | append_option_if_available("-Woverloaded-virtual" cxx_compile_options) |
| | append_option_if_available("-Wcast-qual" cxx_compile_options) |
| | append_option_if_available("-Wno-cast-align" cxx_compile_options) |
| | append_option_if_available("-Wno-long-long" cxx_compile_options) |
| | append_option_if_available("-Wno-variadic-macros" cxx_compile_options) |
| | append_option_if_available("-Wno-unused-function" cxx_compile_options) |
| | append_option_if_available("-Wno-unused-variable" cxx_compile_options) |
| | endif() |
| |
|
| | if ("GNU" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) |
| | |
| | |
| | |
| | append_option_if_available("-Wno-uninitialized" cxx_compile_options) |
| | endif() |
| |
|
| | if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5) |
| | |
| | |
| | append_option_if_available("-Wlogical-op" cxx_compile_options) |
| | endif() |
| |
|
| | if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.3) |
| | |
| | |
| | append_option_if_available("-Wno-noexcept-type" cxx_compile_options) |
| | endif() |
| | endif() |
| |
|
| | if (("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}") OR |
| | ("XL" STREQUAL "${CMAKE_CXX_COMPILER_ID}")) |
| | |
| | |
| | |
| | append_option_if_available("-Wno-unused-parameters" cxx_compile_options) |
| | endif() |
| |
|
| | if ("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | |
| | |
| | append_option_if_available("-Wno-unneeded-internal-declaration" cxx_compile_options) |
| | endif() |
| |
|
| | if ("Feta" STREQUAL "${CMAKE_CUDA_COMPILER_ID}") |
| | |
| | |
| | |
| | |
| | list(APPEND cxx_compile_options -cppsuffix=cu) |
| | endif() |
| |
|
| | add_library(thrust.compiler_interface INTERFACE) |
| |
|
| | foreach (cxx_option IN LISTS cxx_compile_options) |
| | target_compile_options(thrust.compiler_interface INTERFACE |
| | $<$<COMPILE_LANGUAGE:CXX>:${cxx_option}> |
| | $<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CUDA_COMPILER_ID:Feta>>:${cxx_option}> |
| | |
| | |
| | |
| | |
| | |
| | $<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CUDA_COMPILER_ID:NVIDIA>>:-Xcompiler=${cxx_option}> |
| | ) |
| | endforeach() |
| |
|
| | foreach (cxx_definition IN LISTS cxx_compile_definitions) |
| | |
| | target_compile_definitions(thrust.compiler_interface INTERFACE |
| | ${cxx_definition} |
| | ) |
| | endforeach() |
| |
|
| | |
| | target_compile_options(thrust.compiler_interface INTERFACE |
| | |
| | $<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CUDA_COMPILER_ID:NVIDIA>>:-Xcudafe=--display_error_number> |
| | ) |
| |
|
| | |
| | add_library(thrust.promote_cudafe_warnings INTERFACE) |
| | target_compile_options(thrust.promote_cudafe_warnings INTERFACE |
| | $<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CUDA_COMPILER_ID:NVIDIA>>:-Xcudafe=--promote_warnings> |
| | ) |
| | endfunction() |
| |
|