Skip to content

Commit c515b7e

Browse files
MischaMischa
authored andcommitted
Fix review issues in macOS framework build
- Add missing Renderer/TextureTypes.hpp to C++ framework headers - Skip pkg-config generation for playlist in framework mode - Use stored framework path property for install instead of TARGET_FILE_DIR - Show compiler errors on linkability test failure instead of suppressing - Fix comment about framework output location
1 parent 83a41cd commit c515b7e

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

cmake/MacOSFramework.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# [HEADER_SUBDIR <subdirectory name under Headers, defaults to FRAMEWORK_NAME>]
2020
# )
2121
#
22-
# The framework will be created in the same directory as the target's output.
22+
# The framework will be created in CMAKE_CURRENT_BINARY_DIR.
2323
# C_HEADERS are installed flat under Headers/<header-subdir>/
2424
# CXX_HEADERS preserve their directory structure relative to HEADER_BASE_DIR.
2525
#
@@ -175,7 +175,7 @@ function(create_macos_framework)
175175

176176
# Set properties on the framework target for use by install commands
177177
set_target_properties(${FW_TARGET} PROPERTIES
178-
MACOS_FRAMEWORK_LOCATION "${_framework_dir}"
178+
MACOS_FRAMEWORK_OUTPUT_DIR "${_framework_dir}"
179179
MACOS_FRAMEWORK_NAME "${FW_FRAMEWORK_NAME}"
180180
)
181181
endfunction()
@@ -213,8 +213,9 @@ function(install_macos_framework)
213213
set(_component_arg COMPONENT ${FW_COMPONENT})
214214
endif()
215215

216+
get_target_property(_framework_dir ${FW_TARGET} MACOS_FRAMEWORK_OUTPUT_DIR)
216217
install(
217-
DIRECTORY "$<TARGET_FILE_DIR:${FW_TARGET}>/${_framework_name}.framework"
218+
DIRECTORY "${_framework_dir}"
218219
DESTINATION "${FW_DESTINATION}"
219220
${_component_arg}
220221
USE_SOURCE_PERMISSIONS

scripts/test-macos-framework.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ test_linkability() {
117117

118118
echo "$test_code" > "$test_file"
119119

120-
if clang -F "$framework_parent" -I "$include_path" -framework "$framework_name" "$test_file" -o "$test_output" 2>/dev/null; then
120+
local compile_errors
121+
if compile_errors=$(clang -F "$framework_parent" -I "$include_path" -framework "$framework_name" "$test_file" -o "$test_output" 2>&1); then
121122
pass "Linkability test for $framework_name.framework"
122123
else
124+
echo "$compile_errors"
123125
fail "Failed to compile and link against $framework_name.framework"
124126
fi
125127
}
@@ -194,12 +196,14 @@ int main() {
194196
TEMP_FILES+=("$test_file" "$test_output")
195197
echo "$PLAYLIST_TEST_CODE" > "$test_file"
196198

197-
if clang -F "$framework_parent" -F "$projectm_parent" \
199+
compile_errors=""
200+
if compile_errors=$(clang -F "$framework_parent" -F "$projectm_parent" \
198201
-I "$include_path" -I "$projectm_include_path" \
199202
-framework "projectM-4-playlist" -framework "projectM-4" \
200-
"$test_file" -o "$test_output" 2>/dev/null; then
203+
"$test_file" -o "$test_output" 2>&1); then
201204
pass "Linkability test for projectM-4-playlist.framework"
202205
else
206+
echo "$compile_errors"
203207
fail "Failed to compile and link against projectM-4-playlist.framework"
204208
fi
205209
fi

src/libprojectM/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ if(BUILD_SHARED_LIBS)
151151
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/PCM.hpp"
152152
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/WaveformAligner.hpp"
153153
"${CMAKE_CURRENT_SOURCE_DIR}/Renderer/RenderContext.hpp"
154+
"${CMAKE_CURRENT_SOURCE_DIR}/Renderer/TextureTypes.hpp"
154155
"${CMAKE_CURRENT_SOURCE_DIR}/Logging.hpp"
155156
"${CMAKE_CURRENT_SOURCE_DIR}/ProjectM.hpp"
156157
)

src/playlist/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ if(ENABLE_INSTALL)
166166
)
167167
endif()
168168

169-
# pkg-config export, only supported on UNIX systems.
170-
if(UNIX)
169+
# pkg-config export, only supported on UNIX systems (not for frameworks).
170+
if(UNIX AND NOT ENABLE_MACOS_FRAMEWORK)
171171
include(GeneratePkgConfigFiles)
172172

173173
if(ENABLE_BOOST_FILESYSTEM)

0 commit comments

Comments
 (0)