Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS deployment improvements #11

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,41 @@ pushd "build"

darwin*)
export MACOSX_DEPLOYMENT_TARGET="$LL_BUILD_DARWIN_DEPLOY_TARGET"
export MACOSX_ARCHITECTURES="arm64;x86_64"
export MACOSX_EXTRA_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET='${MACOSX_DEPLOYMENT_TARGET}' -DCMAKE_OSX_ARCHITECTURES='${MACOSX_ARCHITECTURES}' -DCMAKE_IGNORE_PREFIX_PATH='/usr/local/'"

# force CPM dependencies glfw and freetype to be built statically to make built executables easier to deploy anywhere
patch --directory "$top/$source_dir" -p1 < "$top/tracy-deps-static.patch"

mkdir -p "$stage_dir/bin"
mkdir -p "capture"
pushd "capture"
cmake "$top/$source_dir/capture" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
cmake "$top/$source_dir/capture" -G Ninja ${MACOSX_EXTRA_CMAKE_ARGS}

cmake --build . --config Release

cp -a tracy-capture $stage_dir/bin
popd

mkdir -p "csvexport"
pushd "csvexport"
cmake "$top/$source_dir/csvexport" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
cmake "$top/$source_dir/csvexport" -G Ninja ${MACOSX_EXTRA_CMAKE_ARGS}
cmake --build . --config Release

cp -a tracy-csvexport $stage_dir/bin
popd

mkdir -p "profiler"
pushd "profiler"
cmake "$top/$source_dir/profiler" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
cmake "$top/$source_dir/profiler" -G Ninja ${MACOSX_EXTRA_CMAKE_ARGS}
cmake --build . --config Release

cp -a tracy-profiler $stage_dir/bin
popd

mkdir -p "update"
pushd "update"
cmake "$top/$source_dir/update" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
cmake "$top/$source_dir/update" -G Ninja ${MACOSX_EXTRA_CMAKE_ARGS}
cmake --build . --config Release

cp -a tracy-update $stage_dir/bin
Expand Down
20 changes: 20 additions & 0 deletions tracy-deps-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/cmake/vendor.cmake b/cmake/vendor.cmake
index bd53a4db..100040e6 100644
--- a/cmake/vendor.cmake
+++ b/cmake/vendor.cmake
@@ -49,6 +49,7 @@ if(NOT USE_WAYLAND AND NOT EMSCRIPTEN)
"GLFW_BUILD_TESTS OFF"
"GLFW_BUILD_DOCS OFF"
"GLFW_INSTALL OFF"
+ "GLFW_LIBRARY_TYPE STATIC"
)
add_library(TracyGlfw3 INTERFACE)
target_link_libraries(TracyGlfw3 INTERFACE glfw)
@@ -70,6 +71,7 @@ else()
OPTIONS
"FT_DISABLE_HARFBUZZ ON"
"FT_WITH_HARFBUZZ OFF"
+ "BUILD_SHARED_LIBS OFF"
)
add_library(TracyFreetype INTERFACE)
target_link_libraries(TracyFreetype INTERFACE freetype)
Loading