diff options
author | Brad King <brad.king@kitware.com> | 2017-06-12 14:17:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-06-12 14:20:58 (GMT) |
commit | 99153a9eb6c3e997dfb07dcf9ea01836f2c384d1 (patch) | |
tree | 202170e74ef8ee9c162c57ce4a00ef7bdcc28103 /Tests/RunCMake | |
parent | 22b412c32574986720198445172e8a460429eba1 (diff) | |
parent | 414438b2fb5a43c447273b425b59cd982818457b (diff) | |
download | CMake-99153a9eb6c3e997dfb07dcf9ea01836f2c384d1.zip CMake-99153a9eb6c3e997dfb07dcf9ea01836f2c384d1.tar.gz CMake-99153a9eb6c3e997dfb07dcf9ea01836f2c384d1.tar.bz2 |
Merge topic 'cuda-compiler-launcher'
414438b2 CUDA: Add option to run the compiler through launcher tools
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !949
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/CUDA.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake | 15 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/main.cu | 4 |
7 files changed, 26 insertions, 5 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 79f487d..7a59824 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -341,6 +341,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") add_RunCMake_test(ClangTidy -DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy>) add_RunCMake_test(IncludeWhatYouUse -DPSEUDO_IWYU=$<TARGET_FILE:pseudo_iwyu>) add_RunCMake_test(Cpplint -DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint>) + if(DEFINED CMake_TEST_CUDA) + list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA}) + endif() add_RunCMake_test(CompilerLauncher) endif() diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake new file mode 100644 index 0000000..6b4b816 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(CUDA.cmake) diff --git a/Tests/RunCMake/CompilerLauncher/CUDA.cmake b/Tests/RunCMake/CompilerLauncher/CUDA.cmake new file mode 100644 index 0000000..fe5560b --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA.cmake @@ -0,0 +1,4 @@ +enable_language(CUDA) +set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1") +set(CMAKE_VERBOSE_MAKEFILE TRUE) +add_executable(main main.cu) diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake index 5884d5c..ab26512 100644 --- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake @@ -15,9 +15,14 @@ function(run_compiler_launcher lang) run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args}) endfunction() -run_compiler_launcher(C) -run_compiler_launcher(CXX) -if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") - run_compiler_launcher(C-launch) - run_compiler_launcher(CXX-launch) +set(langs C CXX) +if(CMake_TEST_CUDA) + list(APPEND langs CUDA) endif() + +foreach(lang ${langs}) + run_compiler_launcher(${lang}) + if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") + run_compiler_launcher(${lang}-launch) + endif() +endforeach() diff --git a/Tests/RunCMake/CompilerLauncher/main.cu b/Tests/RunCMake/CompilerLauncher/main.cu new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/main.cu @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} |