diff options
18 files changed, 38 insertions, 5 deletions
diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst index 77ae1f6..16be3cd 100644 --- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst +++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst @@ -4,7 +4,7 @@ .. versionadded:: 3.4 This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, -``Fortran``, ``OBJC``, ``OBJCXX``, or ``CUDA``. +``Fortran``, ``ISPC``, ``OBJC``, ``OBJCXX``, or ``CUDA``. Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line for a compiler launching tool. The :ref:`Makefile Generators` and the diff --git a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst index 98634c2..89fd7bc 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst @@ -6,7 +6,7 @@ CMAKE_<LANG>_COMPILER_LAUNCHER Default value for :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property. This variable is used to initialize the property on each target as it is created. This is done only when ``<LANG>`` is ``C``, ``CXX``, ``Fortran``, -``OBJC``, ``OBJCXX``, or ``CUDA``. +``ISPC``, ``OBJC``, ``OBJCXX``, or ``CUDA``. This variable is initialized to the :envvar:`CMAKE_<LANG>_COMPILER_LAUNCHER` environment variable if it is set. diff --git a/Modules/CMakeISPCInformation.cmake b/Modules/CMakeISPCInformation.cmake index 514036e..46bda5b 100644 --- a/Modules/CMakeISPCInformation.cmake +++ b/Modules/CMakeISPCInformation.cmake @@ -32,6 +32,11 @@ if(CMAKE_ISPC_STANDARD_LIBRARIES_INIT) mark_as_advanced(CMAKE_ISPC_STANDARD_LIBRARIES) endif() +if(NOT CMAKE_ISPC_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_ISPC_COMPILER_LAUNCHER}) + set(CMAKE_ISPC_COMPILER_LAUNCHER "$ENV{CMAKE_ISPC_COMPILER_LAUNCHER}" + CACHE STRING "Compiler launcher for ISPC.") +endif() + include(CMakeCommonLanguageInclude) # now define the following rules: diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 8d62328..ee97429 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -832,7 +832,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string compilerLauncher; if (!compileCommands.empty() && (lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA" || - lang == "OBJC" || lang == "OBJCXX")) { + lang == "ISPC" || lang == "OBJC" || lang == "OBJCXX")) { std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER"; cmProp clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); if (cmNonempty(clauncher)) { diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 857333c..b19b620 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -813,7 +813,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, std::string compilerLauncher; if (!compileCmds.empty() && (lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA" || - lang == "OBJC" || lang == "OBJCXX")) { + lang == "ISPC" || lang == "OBJC" || lang == "OBJCXX")) { std::string const clauncher_prop = cmStrCat(lang, "_COMPILER_LAUNCHER"); cmProp clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); if (cmNonempty(clauncher)) { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ba648b7..63df96a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -367,6 +367,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("JOB_POOL_COMPILE"); initProp("JOB_POOL_LINK"); initProp("JOB_POOL_PRECOMPILE_HEADER"); + initProp("ISPC_COMPILER_LAUNCHER"); initProp("ISPC_HEADER_DIRECTORY"); initProp("LINK_SEARCH_START_STATIC"); initProp("LINK_SEARCH_END_STATIC"); diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 35f3fa2..35a6ab5 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -629,6 +629,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") if(DEFINED CMake_TEST_CUDA) list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA}) endif() + if(DEFINED CMake_TEST_ISPC) + list(APPEND CompilerLauncher_ARGS -DCMake_TEST_ISPC=${CMake_TEST_ISPC}) + endif() if(CMAKE_Fortran_COMPILER) list(APPEND CompilerLauncher_ARGS -DCMake_TEST_Fortran=1) endif() @@ -637,7 +640,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") endif() add_RunCMake_test(CompilerLauncher) set_property(TEST RunCMake.CompilerLauncher APPEND - PROPERTY LABELS "CUDA") + PROPERTY LABELS "CUDA;ISPC") add_RunCMake_test(ctest_labels_for_subprojects) add_RunCMake_test(CompilerArgs) endif() diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/ISPC-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-common.cmake b/Tests/RunCMake/CompilerLauncher/ISPC-common.cmake new file mode 100644 index 0000000..5beff3d --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-common.cmake @@ -0,0 +1,4 @@ +enable_language(ISPC) +enable_language(CXX) +set(CMAKE_VERBOSE_MAKEFILE TRUE) +add_executable(main main.cxx test.ispc) diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/ISPC-env-launch-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-env-launch-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-env.cmake b/Tests/RunCMake/CompilerLauncher/ISPC-env.cmake new file mode 100644 index 0000000..4afd919 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-env.cmake @@ -0,0 +1 @@ +include(ISPC-common.cmake) diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/ISPC-launch-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-launch-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/ISPC-launch-env.cmake new file mode 100644 index 0000000..f50fb65 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-launch-env.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(ISPC-env.cmake) diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-launch.cmake b/Tests/RunCMake/CompilerLauncher/ISPC-launch.cmake new file mode 100644 index 0000000..b0cafbe --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(ISPC.cmake) diff --git a/Tests/RunCMake/CompilerLauncher/ISPC.cmake b/Tests/RunCMake/CompilerLauncher/ISPC.cmake new file mode 100644 index 0000000..83efa80 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/ISPC.cmake @@ -0,0 +1,2 @@ +set(CMAKE_ISPC_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1") +include(ISPC-common.cmake) diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake index 69fff20..293d711 100644 --- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake @@ -29,6 +29,9 @@ endif() if(CMake_TEST_Fortran) list(APPEND langs Fortran) endif() +if(CMake_TEST_ISPC) + list(APPEND langs ISPC) +endif() if(CMake_TEST_OBJC) list(APPEND langs OBJC OBJCXX) endif() diff --git a/Tests/RunCMake/CompilerLauncher/test.ispc b/Tests/RunCMake/CompilerLauncher/test.ispc new file mode 100644 index 0000000..b061f40 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/test.ispc @@ -0,0 +1,4 @@ + +float func(float a, float b) { + return a + b / 2.; +} |