| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | function(cub_build_compiler_targets) |
| | set(cxx_compile_definitions) |
| | set(cxx_compile_options) |
| | set(cuda_compile_options) |
| |
|
| | if ("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | append_option_if_available("/W4" cxx_compile_options) |
| |
|
| | append_option_if_available("/WX" cxx_compile_options) |
| |
|
| | |
| | |
| | append_option_if_available("/wd4324" cxx_compile_options) |
| | |
| | |
| | |
| | |
| | |
| | append_option_if_available("/wd4127" cxx_compile_options) |
| | |
| | |
| | |
| | append_option_if_available("/wd4505" cxx_compile_options) |
| | |
| | |
| | |
| | |
| | |
| | append_option_if_available("/wd4706" cxx_compile_options) |
| |
|
| | |
| | append_option_if_available("/bigobj" cxx_compile_options) |
| | else() |
| | append_option_if_available("-Wreorder" cuda_compile_options) |
| |
|
| | 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("-Wpointer-arith" cxx_compile_options) |
| | append_option_if_available("-Wunused-local-typedef" cxx_compile_options) |
| | append_option_if_available("-Wvla" cxx_compile_options) |
| |
|
| | |
| | append_option_if_available("-Wgnu" cxx_compile_options) |
| | |
| | |
| | |
| | append_option_if_available("-Wno-gnu-zero-variadic-macro-arguments" cxx_compile_options) |
| |
|
| | |
| | append_option_if_available("-Wno-unused-function" cxx_compile_options) |
| | endif() |
| |
|
| | if ("GNU" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.3) |
| | |
| | |
| | append_option_if_available("-Wno-noexcept-type" cxx_compile_options) |
| | endif() |
| | endif() |
| |
|
| | if ("Intel" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | |
| | append_option_if_available("-diag-disable=11074" cxx_compile_options) |
| | append_option_if_available("-diag-disable=11076" cxx_compile_options) |
| | endif() |
| |
|
| | if ("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}") |
| | option(CUB_ENABLE_CT_PROFILING "Enable compilation time profiling" OFF) |
| | if (CUB_ENABLE_CT_PROFILING) |
| | append_option_if_available("-ftime-trace" cxx_compile_options) |
| | endif() |
| | endif() |
| |
|
| | if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}") |
| | list(APPEND cxx_compile_options -Mnodaz) |
| | |
| | list(APPEND cxx_compile_options -gpu=nomanaged) |
| | endif() |
| |
|
| | add_library(cub.compiler_interface INTERFACE) |
| |
|
| | foreach (cxx_option IN LISTS cxx_compile_options) |
| | target_compile_options(cub.compiler_interface INTERFACE |
| | $<$<COMPILE_LANGUAGE:CXX>:${cxx_option}> |
| | $<$<COMPILE_LANG_AND_ID:CUDA,NVCXX>:${cxx_option}> |
| | |
| | |
| | |
| | |
| | |
| | $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Xcompiler=${cxx_option}> |
| | ) |
| | endforeach() |
| |
|
| | foreach (cuda_option IN LISTS cuda_compile_options) |
| | target_compile_options(cub.compiler_interface INTERFACE |
| | $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:${cuda_option}> |
| | ) |
| | endforeach() |
| |
|
| | |
| | target_compile_definitions(cub.compiler_interface INTERFACE |
| | ${cxx_compile_definitions} |
| | ) |
| |
|
| | |
| | target_compile_options(cub.compiler_interface INTERFACE |
| | |
| | |
| | $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Xcudafe=--display_error_number> |
| | |
| | $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Xcudafe=--promote_warnings> |
| | |
| | $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Wno-deprecated-gpu-targets> |
| | ) |
| | endfunction() |
| |
|