mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-08 15:19:51 -05:00
Xcode: Fix post build script for 'top level project only' opt
When CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY is set on Xcode generator created post build scripts which tried to call XCODE_DEPEND_HELPER.make script in subproject. But XCODE_DEPEND_HELPER.make don't exist in subprojects when mentioned option is set on. Fixes: #20262
This commit is contained in:
committed by
Brad King
parent
33e7bd66c0
commit
64304fe72b
@@ -8,6 +8,16 @@ run_cmake(XcodeAttributeLocation)
|
||||
run_cmake(XcodeAttributeGenex)
|
||||
run_cmake(XcodeAttributeGenexError)
|
||||
run_cmake(XcodeGenerateTopLevelProjectOnly)
|
||||
|
||||
function(XcodeGenerateTopLevelProjectOnlyWithObjectLibrary)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeGenerateTopLevelProjectOnlyWithObjectLibrary-build)
|
||||
run_cmake(XcodeGenerateTopLevelProjectOnlyWithObjectLibrary)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
run_cmake_command(XcodeGenerateTopLevelProjectOnlyWithObjectLibrary-build ${CMAKE_COMMAND} --build . --target shared_lib)
|
||||
endfunction()
|
||||
|
||||
XcodeGenerateTopLevelProjectOnlyWithObjectLibrary()
|
||||
|
||||
run_cmake(XcodeObjectNeedsEscape)
|
||||
run_cmake(XcodeObjectNeedsQuote)
|
||||
run_cmake(XcodeOptimizationFlags)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
|
||||
project(XcodeGenerateTopLevelProjectOnly NONE)
|
||||
add_subdirectory(subproject_with_object_lib)
|
||||
@@ -0,0 +1,7 @@
|
||||
project(subproject_with_object_lib)
|
||||
|
||||
add_library(object_lib_dependency OBJECT dummy.cpp)
|
||||
|
||||
add_library(shared_lib SHARED dummy.cpp)
|
||||
target_sources(shared_lib PRIVATE $<TARGET_OBJECTS:object_lib_dependency>)
|
||||
set_target_properties(shared_lib PROPERTIES MACOSX_RPATH ON)
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace {
|
||||
void dummy()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user