summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-01-07 12:40:33 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-09 18:52:37 (GMT)
commit1a9f6bad987d9b08330e59451955a8df9db21c3b (patch)
tree594407b9d7375bfa71f4c2d19d59e034d52e31db /Tests
parentd4d11b17078a6690aca122d7f7ec62475cedccfc (diff)
downloadCMake-1a9f6bad987d9b08330e59451955a8df9db21c3b.zip
CMake-1a9f6bad987d9b08330e59451955a8df9db21c3b.tar.gz
CMake-1a9f6bad987d9b08330e59451955a8df9db21c3b.tar.bz2
ObjC: Add _COMPILE_LAUNCHER support
Fixes: #20178
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC.cmake2
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX.cmake2
-rw-r--r--Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/main.m4
-rw-r--r--Tests/RunCMake/CompilerLauncher/main.mm4
22 files changed, 46 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index cfb6ffe..a46393e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -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()
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-common.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-common.cmake
new file mode 100644
index 0000000..7b565f4
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-common.cmake
@@ -0,0 +1,3 @@
+enable_language(OBJC)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.m)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-env.cmake
new file mode 100644
index 0000000..949e88d
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env.cmake
@@ -0,0 +1 @@
+include(OBJC-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake
new file mode 100644
index 0000000..1cf13d3
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJC-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake
new file mode 100644
index 0000000..43e8521
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJC.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC.cmake b/Tests/RunCMake/CompilerLauncher/OBJC.cmake
new file mode 100644
index 0000000..3374e82
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_OBJC_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+include(OBJC-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake
new file mode 100644
index 0000000..e2ee4eb
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake
@@ -0,0 +1,3 @@
+enable_language(OBJCXX)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.mm)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake
new file mode 100644
index 0000000..3ed966d
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake
@@ -0,0 +1 @@
+include(OBJCXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake
new file mode 100644
index 0000000..04c916a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJCXX-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake
new file mode 100644
index 0000000..5a54bff
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJCXX.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX.cmake
new file mode 100644
index 0000000..993ec90
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+include(OBJCXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
index e9543f1..69fff20 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_OBJC)
+ list(APPEND langs OBJC OBJCXX)
+endif()
foreach(lang ${langs})
run_compiler_launcher(${lang})
diff --git a/Tests/RunCMake/CompilerLauncher/main.m b/Tests/RunCMake/CompilerLauncher/main.m
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/main.m
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CompilerLauncher/main.mm b/Tests/RunCMake/CompilerLauncher/main.mm
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/main.mm
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}