summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-14 20:11:25 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-15 16:12:12 (GMT)
commit55fb46d273e8ab51d5df366286052c71b9008437 (patch)
treeb51aed5c4387892813e3788cc49573450efebba3 /Modules/Compiler
parentd7c80f60362cbc40216fab67318d94988030315c (diff)
downloadCMake-55fb46d273e8ab51d5df366286052c71b9008437.zip
CMake-55fb46d273e8ab51d5df366286052c71b9008437.tar.gz
CMake-55fb46d273e8ab51d5df366286052c71b9008437.tar.bz2
CUDA: Fix default compiler flags on Windows
Fix the default values of `CMAKE_CUDA_FLAGS[_<CONFIG>]` on Windows to make the host compiler flags match those produced for C++ by the `Platform/Windows-MSVC` module. This makes the flags consistent with those used for C++.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake11
1 files changed, 5 insertions, 6 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index 7903313..316cab8 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -7,16 +7,15 @@ if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
# CMAKE_SHARED_LIBRARY_CUDA_FLAGS is sent to the host linker so we
# don't need to forward it through nvcc.
set(CMAKE_SHARED_LIBRARY_CUDA_FLAGS -fPIC)
+ string(APPEND CMAKE_CUDA_FLAGS_INIT " ")
+ string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -g")
+ string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
+ string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
+ string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
endif()
set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS -shared)
set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA -isystem=)
-string(APPEND CMAKE_CUDA_FLAGS_INIT " ")
-string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -g")
-string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
-string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
-string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
-
if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CUDA_STANDARD_DEFAULT "")
else()