summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeCUDAInformation.cmake6
-rw-r--r--Modules/Platform/Windows-NVIDIA-CUDA.cmake2
-rw-r--r--Tests/Cuda/WithC/main.c8
3 files changed, 16 insertions, 0 deletions
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 13b1789..1c48159 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -93,6 +93,12 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
endif()
+if(CMAKE_CUDA_STANDARD_LIBRARIES_INIT)
+ set(CMAKE_CUDA_STANDARD_LIBRARIES "${CMAKE_CUDA_STANDARD_LIBRARIES_INIT}"
+ CACHE STRING "Libraries linked by default with all CUDA applications.")
+ mark_as_advanced(CMAKE_CUDA_STANDARD_LIBRARIES)
+endif()
+
include(CMakeCommonLanguageInclude)
# now define the following rules:
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index 809ee06..eda41e0 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -40,3 +40,5 @@ 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")
+
+set(CMAKE_CUDA_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
diff --git a/Tests/Cuda/WithC/main.c b/Tests/Cuda/WithC/main.c
index f9101a7..cb5fddc 100644
--- a/Tests/Cuda/WithC/main.c
+++ b/Tests/Cuda/WithC/main.c
@@ -1,6 +1,14 @@
extern int use_cuda(void);
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
int main()
{
+#ifdef _WIN32
+ /* Use an API that requires CMake's "standard" C libraries. */
+ GetOpenFileName(NULL);
+#endif
return use_cuda();
}