mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 11:39:48 +00:00
parent
d4d11b1707
commit
1a9f6bad98
@ -2,7 +2,7 @@
|
||||
------------------------
|
||||
|
||||
This property is implemented only when ``<LANG>`` is ``C``, ``CXX``,
|
||||
``Fortran``, or ``CUDA``.
|
||||
``Fortran``, ``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
|
||||
|
@ -4,7 +4,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``,
|
||||
or ``CUDA``.
|
||||
``OBJC``, ``OBJCXX``, or ``CUDA``.
|
||||
|
||||
This variable is initialized to the :envvar:`CMAKE_<LANG>_COMPILER_LAUNCHER`
|
||||
environment variable if it is set.
|
||||
|
@ -110,6 +110,11 @@ if(CMAKE_OBJC_STANDARD_LIBRARIES_INIT)
|
||||
mark_as_advanced(CMAKE_OBJC_STANDARD_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_OBJC_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_OBJC_COMPILER_LAUNCHER})
|
||||
set(CMAKE_OBJC_COMPILER_LAUNCHER "$ENV{CMAKE_OBJC_COMPILER_LAUNCHER}"
|
||||
CACHE STRING "Compiler launcher for OBJC.")
|
||||
endif()
|
||||
|
||||
include(CMakeCommonLanguageInclude)
|
||||
|
||||
# now define the following rule variables
|
||||
|
@ -203,6 +203,11 @@ if(CMAKE_OBJCXX_STANDARD_LIBRARIES_INIT)
|
||||
mark_as_advanced(CMAKE_OBJCXX_STANDARD_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_OBJCXX_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_OBJCXX_COMPILER_LAUNCHER})
|
||||
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "$ENV{CMAKE_OBJCXX_COMPILER_LAUNCHER}"
|
||||
CACHE STRING "Compiler launcher for OBJCXX.")
|
||||
endif()
|
||||
|
||||
include(CMakeCommonLanguageInclude)
|
||||
|
||||
# now define the following rules:
|
||||
|
@ -754,8 +754,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
||||
// See if we need to use a compiler launcher like ccache or distcc
|
||||
std::string compilerLauncher;
|
||||
if (!compileCommands.empty() &&
|
||||
(lang == "C" || lang == "CXX" || lang == "Fortran" ||
|
||||
lang == "CUDA")) {
|
||||
(lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA" ||
|
||||
lang == "OBJC" || lang == "OBJCXX")) {
|
||||
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
|
||||
const char* clauncher =
|
||||
this->GeneratorTarget->GetProperty(clauncher_prop);
|
||||
|
@ -724,7 +724,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
|
||||
// See if we need to use a compiler launcher like ccache or distcc
|
||||
std::string compilerLauncher;
|
||||
if (!compileCmds.empty() &&
|
||||
(lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA")) {
|
||||
(lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA" ||
|
||||
lang == "OBJC" || lang == "OBJCXX")) {
|
||||
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
|
||||
const char* clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
|
||||
if (clauncher && *clauncher) {
|
||||
|
@ -336,6 +336,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
initProp("C_STANDARD");
|
||||
initProp("C_STANDARD_REQUIRED");
|
||||
initProp("C_EXTENSIONS");
|
||||
initProp("OBJC_COMPILER_LAUNCHER");
|
||||
initProp("OBJC_STANDARD");
|
||||
initProp("OBJC_STANDARD_REQUIRED");
|
||||
initProp("OBJC_EXTENSIONS");
|
||||
@ -347,6 +348,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
initProp("CXX_STANDARD");
|
||||
initProp("CXX_STANDARD_REQUIRED");
|
||||
initProp("CXX_EXTENSIONS");
|
||||
initProp("OBJCXX_COMPILER_LAUNCHER");
|
||||
initProp("OBJCXX_STANDARD");
|
||||
initProp("OBJCXX_STANDARD_REQUIRED");
|
||||
initProp("OBJCXX_EXTENSIONS");
|
||||
|
@ -544,6 +544,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_Fortran=1)
|
||||
endif()
|
||||
if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
|
||||
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_OBJC=1)
|
||||
endif()
|
||||
add_RunCMake_test(CompilerLauncher)
|
||||
add_RunCMake_test(ctest_labels_for_subprojects)
|
||||
endif()
|
||||
|
1
Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt
Normal file
1
Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt
Normal file
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
3
Tests/RunCMake/CompilerLauncher/OBJC-common.cmake
Normal file
3
Tests/RunCMake/CompilerLauncher/OBJC-common.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
enable_language(OBJC)
|
||||
set(CMAKE_VERBOSE_MAKEFILE TRUE)
|
||||
add_executable(main main.m)
|
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
1
Tests/RunCMake/CompilerLauncher/OBJC-env.cmake
Normal file
1
Tests/RunCMake/CompilerLauncher/OBJC-env.cmake
Normal file
@ -0,0 +1 @@
|
||||
include(OBJC-common.cmake)
|
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
3
Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake
Normal file
3
Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
include(CTestUseLaunchers)
|
||||
include(OBJC-env.cmake)
|
3
Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake
Normal file
3
Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
include(CTestUseLaunchers)
|
||||
include(OBJC.cmake)
|
2
Tests/RunCMake/CompilerLauncher/OBJC.cmake
Normal file
2
Tests/RunCMake/CompilerLauncher/OBJC.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
set(CMAKE_OBJC_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
|
||||
include(OBJC-common.cmake)
|
1
Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt
Normal file
1
Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt
Normal file
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
3
Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake
Normal file
3
Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
enable_language(OBJCXX)
|
||||
set(CMAKE_VERBOSE_MAKEFILE TRUE)
|
||||
add_executable(main main.mm)
|
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
1
Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake
Normal file
1
Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake
Normal file
@ -0,0 +1 @@
|
||||
include(OBJCXX-common.cmake)
|
@ -0,0 +1 @@
|
||||
.*-E env USED_LAUNCHER=1.*
|
3
Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake
Normal file
3
Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
include(CTestUseLaunchers)
|
||||
include(OBJCXX-env.cmake)
|
3
Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake
Normal file
3
Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
include(CTestUseLaunchers)
|
||||
include(OBJCXX.cmake)
|
2
Tests/RunCMake/CompilerLauncher/OBJCXX.cmake
Normal file
2
Tests/RunCMake/CompilerLauncher/OBJCXX.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
|
||||
include(OBJCXX-common.cmake)
|
@ -29,6 +29,9 @@ endif()
|
||||
if(CMake_TEST_Fortran)
|
||||
list(APPEND langs Fortran)
|
||||
endif()
|
||||
if(CMake_TEST_OBJC)
|
||||
list(APPEND langs OBJC OBJCXX)
|
||||
endif()
|
||||
|
||||
foreach(lang ${langs})
|
||||
run_compiler_launcher(${lang})
|
||||
|
4
Tests/RunCMake/CompilerLauncher/main.m
Normal file
4
Tests/RunCMake/CompilerLauncher/main.m
Normal file
@ -0,0 +1,4 @@
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
4
Tests/RunCMake/CompilerLauncher/main.mm
Normal file
4
Tests/RunCMake/CompilerLauncher/main.mm
Normal file
@ -0,0 +1,4 @@
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user