[Cmake-commits] CMake branch, next, updated. v3.8.0-rc1-182-gb0ea076

Brad King brad.king at kitware.com
Wed Feb 15 11:12:26 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  b0ea076370600cd3e6a5d04a90667c0d2a8e4727 (commit)
       via  55fb46d273e8ab51d5df366286052c71b9008437 (commit)
       via  d7c80f60362cbc40216fab67318d94988030315c (commit)
      from  d4c222c5af0612ae0ec200bc540a733d0941fa19 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0ea076370600cd3e6a5d04a90667c0d2a8e4727
commit b0ea076370600cd3e6a5d04a90667c0d2a8e4727
Merge: d4c222c 55fb46d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 15 11:12:26 2017 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 15 11:12:26 2017 -0500

    Merge topic 'cuda-msvc-flags' into next
    
    55fb46d2 CUDA: Fix default compiler flags on Windows
    d7c80f60 CUDA: Fix test cases to not override CUDA flags


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55fb46d273e8ab51d5df366286052c71b9008437
commit 55fb46d273e8ab51d5df366286052c71b9008437
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 14 15:11:25 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 15 11:12:12 2017 -0500

    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++.

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()
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index eda41e0..845fa4b 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -35,10 +35,12 @@ set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
 set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
   "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
 
-string(APPEND CMAKE_CUDA_FLAGS_INIT " -Xcompiler=-GR,-EHsc")
-string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -Xcompiler=-MDd,-Zi,-RTC1")
-string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -Xcompiler=-MD")
-string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -Xcompiler=-MD")
-string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -Xcompiler=-MD")
+string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}")
+
+string(APPEND CMAKE_CUDA_FLAGS_INIT " ${PLATFORM_DEFINES_CUDA} -D_WINDOWS -Xcompiler=\"/W3${_FLAGS_CXX}\"")
+string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -Xcompiler=\"-MDd -Zi -Ob0 -Od ${_RTC1}\"")
+string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -Xcompiler=\"-MD -O2 -Ob2\" -DNDEBUG")
+string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -Xcompiler=\"-MD -Zi -O2 -Ob1\" -DNDEBUG")
+string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -Xcompiler=\"-MD -O1 -Ob1\" -DNDEBUG")
 
 set(CMAKE_CUDA_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7c80f60362cbc40216fab67318d94988030315c
commit d7c80f60362cbc40216fab67318d94988030315c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 14 15:09:55 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 15 11:12:09 2017 -0500

    CUDA: Fix test cases to not override CUDA flags
    
    Append to `CMAKE_CUDA_FLAGS` instead of overwriting it.

diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt
index 9a3703a..bff7d07 100644
--- a/Tests/Cuda/Complex/CMakeLists.txt
+++ b/Tests/Cuda/Complex/CMakeLists.txt
@@ -15,7 +15,7 @@ project (CudaComplex CXX CUDA)
 #and also bulding cpp targets that need cuda implicit libraries
 
 #verify that we can pass explicit cuda arch flags
-set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
 set(CMAKE_CUDA_STANDARD 11)
 set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
diff --git a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt
index a9eb8bd..b6e0e39 100644
--- a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt
+++ b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt
@@ -9,7 +9,7 @@ project (ProperLinkFlags CUDA CXX)
 
 #Specify a set of valid CUDA flags and an invalid set of CXX flags ( for CUDA )
 #to make sure we don't use the CXX flags when linking CUDA executables
-set(CMAKE_CUDA_FLAGS "-arch=sm_35 --use_fast_math")
+string(APPEND CMAKE_CUDA_FLAGS " -arch=sm_35 --use_fast_math")
 set(CMAKE_CXX_FLAGS "-Wall")
 
 set(CMAKE_CXX_STANDARD 11)
diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt
index 7596804..1f25ab4 100644
--- a/Tests/Cuda/WithC/CMakeLists.txt
+++ b/Tests/Cuda/WithC/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.7)
 project(CudaComplex CUDA C)
 
-set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
 
 add_executable(CudaWithC main.c cuda.cu)
 
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
index 7055eef..d134b96 100644
--- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
+++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
@@ -9,7 +9,7 @@ project (CudaOnlySeparateCompilation CUDA)
 #and executables.
 #We complicate the matter by also testing that multiple static libraries
 #all containing cuda separable compilation code links properly
-set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
 set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CUDA_STANDARD 11)
 add_library(CUDASerarateLibA STATIC file1.cu file2.cu file3.cu)
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 6c4011c..2646d29 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.7)
 project (CudaOnlyWithDefs CUDA)
 
 #verify that we can pass explicit cuda arch flags
-set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
 set(debug_compile_flags --generate-code arch=compute_20,code=sm_20)
 if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
   list(APPEND debug_compile_flags -Xcompiler=-WX)

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list