summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-14 10:34:10 -0500
committerBrad King <brad.king@kitware.com>2017-02-14 10:34:15 -0500
commit1c60231ca546597ef8b80e7340c8991b06387cbf (patch)
tree4fdbe8a21f58d5b0ea665c5f6cc3fdc181da074c /Tests
parent8d75d8dc72a0ac4502991891782a2c84df1f61c3 (diff)
downloadcmake-1c60231ca546597ef8b80e7340c8991b06387cbf.tar.gz
CUDA: Link to standard system libraries when linking as CUDA
On Windows with MSVC-like host compilers we must honor the standard libraries chosen by the `Platform/Windows-MSVC` module. Otherwise C code linked into the CUDA binary that expects to have these libraries available may not link.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Cuda/WithC/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/Cuda/WithC/main.c b/Tests/Cuda/WithC/main.c
index f9101a7068..cb5fddc1fe 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();
}