mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
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
This commit is contained in:
@@ -2552,7 +2552,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
||||
|
||||
// Store the product name for all target types.
|
||||
buildSettings->AddAttribute("PRODUCT_NAME", this->CreateString(realName));
|
||||
buildSettings->AddAttribute("SYMROOT", this->CreateString(pndir));
|
||||
|
||||
// Handle settings for each target type.
|
||||
switch (gtgt->GetType()) {
|
||||
|
||||
2
Tests/RunCMake/XcodeProject/Clean.cmake
Normal file
2
Tests/RunCMake/XcodeProject/Clean.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
enable_language(C)
|
||||
add_subdirectory(Clean)
|
||||
1
Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt
Normal file
1
Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_library(empty empty.c)
|
||||
0
Tests/RunCMake/XcodeProject/Clean/empty.c
Normal file
0
Tests/RunCMake/XcodeProject/Clean/empty.c
Normal file
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user