summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-29 18:44:01 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-29 19:04:08 (GMT)
commitd0a6ebf57bf4d42a5b6875d3064ce1c207b9cc40 (patch)
treed70d1c71ad8dd36c53abdb41350cf508239c275c /Tests
parentdc5fc898f68846b24723b5702731ee2efb94f603 (diff)
downloadCMake-d0a6ebf57bf4d42a5b6875d3064ce1c207b9cc40.zip
CMake-d0a6ebf57bf4d42a5b6875d3064ce1c207b9cc40.tar.gz
CMake-d0a6ebf57bf4d42a5b6875d3064ce1c207b9cc40.tar.bz2
Xcode: Fix "clean" operation under the "new build system"
Previously we set `SYMROOT` to tell Xcode where to place the build products. However, the "clean" operation in the Xcode "new build system" expects that only Xcode creates the `SYMROOT` directory or contents inside it. Since we create that directory, "clean" fails. We now explicitly set `CONFIGURATION_BUILD_DIR` and `TARGET_TEMP_DIR` instead of letting Xcode compute their values from `SYMROOT`, so we no longer need to set the latter. Drop the now-unnecessary `SYMROOT`. Fixes: #22550
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/XcodeProject/Clean.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/XcodeProject/Clean/empty.c0
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake8
4 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/Clean.cmake b/Tests/RunCMake/XcodeProject/Clean.cmake
new file mode 100644
index 0000000..1ab7e10
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/Clean.cmake
@@ -0,0 +1,2 @@
+enable_language(C)
+add_subdirectory(Clean)
diff --git a/Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt b/Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt
new file mode 100644
index 0000000..59e62cb
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(empty empty.c)
diff --git a/Tests/RunCMake/XcodeProject/Clean/empty.c b/Tests/RunCMake/XcodeProject/Clean/empty.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/Clean/empty.c
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index d20f5a6..879b38e 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,5 +1,13 @@
include(RunCMake)
+function(RunClean)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Clean-build)
+ run_cmake(Clean)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(Clean-build xcodebuild clean)
+endfunction()
+RunClean()
+
run_cmake(ExplicitCMakeLists)
run_cmake(ImplicitCMakeLists)
run_cmake(InterfaceLibSources)