aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2021-12-29 14:55:19 +1000
committerGitHub <noreply@github.com>2021-12-29 14:55:19 +1000
commit13460f3eba9f36a10a29f4769ff824007568ace2 (patch)
tree08bd9ab51947b63573e2b709d990812f6a56a6d6 /CMakeLists.txt
parente50b43d01a3bd2bfe880b99d962008b087ab8635 (diff)
parente51a952f26ec74ec0a554607e407f3a77c7c1fdf (diff)
Merge pull request #20655 from fuzzard/cmake_macos_targetgen
[cmake] work around target gen expression issues for xcode projects
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 447d08f589..3abd1b6a63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,7 +311,17 @@ endif()
set(GLOBAL_TARGET_DEPS ffmpeg dvdnav crossguid fmt spdlog fstrcmp flatbuffers ${PLATFORM_GLOBAL_TARGET_DEPS})
# main library (used for main binary and tests)
-add_library(lib${APP_NAME_LC} STATIC $<TARGET_OBJECTS:compileinfo>)
+if(CMAKE_GENERATOR STREQUAL Xcode)
+ add_library(compileinfo_obj OBJECT IMPORTED)
+ set_property(TARGET compileinfo_obj PROPERTY IMPORTED_OBJECTS
+ "${CMAKE_BINARY_DIR}/$(PROJECT_NAME).build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/compileinfo.build/$(OBJECT_FILE_DIR_normal:base)/$(CURRENT_ARCH)/CompileInfo.o"
+ )
+ add_library(lib${APP_NAME_LC} STATIC)
+ add_dependencies(lib${APP_NAME_LC} compileinfo)
+ target_link_libraries(lib${APP_NAME_LC} PUBLIC compileinfo_obj)
+else()
+ add_library(lib${APP_NAME_LC} STATIC $<TARGET_OBJECTS:compileinfo>)
+endif()
add_dependencies(lib${APP_NAME_LC} ${GLOBAL_TARGET_DEPS})
set_target_properties(lib${APP_NAME_LC} PROPERTIES PREFIX "")