Skip to content

Commit 6a324b6

Browse files
authored
Improve cmake (axmolengine#3015)
1. avoid copy xcfraemwork .a to bin dir 2. avoid macos openal bundle id mismatch warning
1 parent 1f611f5 commit 6a324b6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

3rdparty/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ function(ax_add_3rd source_dir)
111111
add_dependencies(3rdparty ${tgt})
112112
endif()
113113

114-
get_target_property(_is_imported_lib ${tgt} IMPORTED)
115-
116-
if(NOT _is_imported_lib AND NOT (tgt_type STREQUAL "INTERFACE_LIBRARY"))
114+
if(NOT (tgt_type STREQUAL "INTERFACE_LIBRARY"))
117115
set_target_properties(${tgt} PROPERTIES
118116
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" # Windows/Linux/macOS, .a, .lib
119117
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" # Windows .dll, .exe
@@ -250,6 +248,10 @@ if(AX_ENABLE_AUDIO)
250248
"ALSOFT_UTILS OFF"
251249
"ALSOFT_EXAMPLES OFF"
252250
"ALSOFT_INSTALL OFF"
251+
"ALSOFT_INSTALL_CONFIG OFF"
252+
"ALSOFT_INSTALL_HRTF_DATA OFF"
253+
"ALSOFT_INSTALL_AMBDEC_PRESETS OFF"
254+
"ALSOFT_INSTALL_UTILS OFF"
253255
"ALSOFT_ENABLE_MODULES OFF"
254256
)
255257

3rdparty/openal/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1742,11 +1742,12 @@ else()
17421742
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
17431743
endif()
17441744

1745+
set(_alsoft_bundle_id "org.openal-soft.openal")
17451746
set_target_properties(${IMPL_TARGET} PROPERTIES
17461747
FRAMEWORK TRUE
17471748
FRAMEWORK_VERSION C
17481749
MACOSX_FRAMEWORK_NAME "${IMPL_TARGET}"
1749-
MACOSX_FRAMEWORK_IDENTIFIER "org.openal-soft.openal"
1750+
MACOSX_FRAMEWORK_IDENTIFIER "${_alsoft_bundle_id}"
17501751
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${OpenAL_VERSION}"
17511752
MACOSX_FRAMEWORK_BUNDLE_VERSION "${BUNDLE_VERSION}"
17521753
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
@@ -1757,6 +1758,7 @@ else()
17571758
XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES"
17581759
XCODE_ATTRIBUTE_ENABLE_STDEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
17591760
XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR "$(inherited)"
1761+
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${_alsoft_bundle_id}"
17601762
PUBLIC_HEADER "${TARGET_PUBLIC_HEADERS}"
17611763
MACOSX_RPATH TRUE)
17621764
endif()

0 commit comments

Comments
 (0)