Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/brad/macos-universal-static' int…
Browse files Browse the repository at this point in the history
…o rye/tracy0111
  • Loading branch information
RyeMutt committed Nov 6, 2024
2 parents 2bba478 + 2219b06 commit e5d5031
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
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)

0 comments on commit e5d5031

Please sign in to comment.