mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Xcode: Fix erroneous MACOSX_BUNDLE link
Refactoring in commit a2cfa2da4f (GenEx/LINK_LIBRARY: Add features for
framework support on Apple, 2022-02-10, v3.24.0-rc1~661^2) accidentally
removed a `GetParentDirectory` call. Restore it.
Fixes: #23891
This commit is contained in:
@@ -3622,6 +3622,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
linkDir = cmSystemTools::GetParentDirectory(linkDir);
|
||||
if (std::find(linkSearchPaths.begin(), linkSearchPaths.end(), linkDir) ==
|
||||
linkSearchPaths.end()) {
|
||||
linkSearchPaths.push_back(linkDir);
|
||||
|
||||
14
Tests/RunCMake/XcodeProject/BundleLinkBundle.cmake
Normal file
14
Tests/RunCMake/XcodeProject/BundleLinkBundle.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.23)
|
||||
|
||||
project(BundleLinkBundle CXX)
|
||||
|
||||
add_subdirectory(lib_bundle)
|
||||
|
||||
add_executable(MainBundle MACOSX_BUNDLE main_bundle.cpp)
|
||||
|
||||
target_link_libraries(MainBundle PRIVATE LibBundle)
|
||||
|
||||
set_target_properties(MainBundle PROPERTIES
|
||||
MACOSX_BUNDLE "YES"
|
||||
XCODE_LINK_BUILD_PHASE_MODE BUILT_ONLY
|
||||
)
|
||||
@@ -151,6 +151,16 @@ endfunction()
|
||||
|
||||
XcodeXCConfig()
|
||||
|
||||
function(BundleLinkBundle)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BundleLinkBundle-build)
|
||||
run_cmake(BundleLinkBundle)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
run_cmake_command(BundleLinkBundle-build ${CMAKE_COMMAND} --build .)
|
||||
endfunction()
|
||||
|
||||
BundleLinkBundle()
|
||||
|
||||
|
||||
# Isolate device tests from host architecture selection.
|
||||
unset(ENV{CMAKE_OSX_ARCHITECTURES})
|
||||
|
||||
|
||||
5
Tests/RunCMake/XcodeProject/lib_bundle/CMakeLIsts.txt
Normal file
5
Tests/RunCMake/XcodeProject/lib_bundle/CMakeLIsts.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
add_library(LibBundle lib_bundle.cpp)
|
||||
|
||||
set_target_properties(LibBundle PROPERTIES
|
||||
MACOSX_BUNDLE YES)
|
||||
6
Tests/RunCMake/XcodeProject/lib_bundle/lib_bundle.cpp
Normal file
6
Tests/RunCMake/XcodeProject/lib_bundle/lib_bundle.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
void foo()
|
||||
{
|
||||
std::cout << "foobar" << std::endl;
|
||||
}
|
||||
9
Tests/RunCMake/XcodeProject/main_bundle.cpp
Normal file
9
Tests/RunCMake/XcodeProject/main_bundle.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
extern void foo();
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
foo();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user