Skip to content

Commit

Permalink
Fix macOS linking
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyquagsire23 committed Sep 20, 2024
1 parent 726d038 commit 1add937
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
brew install cmake make imagemagick
pip3 install cogapp generate-iconset
brew install openal-soft sdl2 sdl2_mixer glew libmodplug libpng
brew install openssl@1.1 protobuf
brew install openssl@3 protobuf
- name: cmake
run: export HOMEBREW_PREFIX="/usr/local" && ./.github/build_macos.sh
4 changes: 2 additions & 2 deletions build_run_openjkdf2_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export OPENJKDF2_RELEASE_COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
mkdir -p build_darwin64 && cd build_darwin64

export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@3/lib/pkgconfig
TARGET_BUILD_TESTS=1 DEBUG_QOL_CHEATS=1 OPENJKDF2_NO_ASAN=0 cmake .. &&
TARGET_BUILD_TESTS=1 DEBUG_QOL_CHEATS=1 OPENJKDF2_NO_ASAN=0 make -j10 &&
cd .. &&
Expand All @@ -25,7 +25,7 @@ echo "Running..." &&
#OPENJKDF2_ROOT="/Users/maxamillion/.local/share/openjkdf2_todoa" LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 -- -enhancedCogVerbs #-- -verboseNetworking
#OPENJKDF2_ROOT="/Users/maxamillion/.local/share/openjkdf2_todoa2012" LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 -- -enhancedCogVerbs #-- -verboseNetworking
#OPENJKDF2_ROOT="/Users/maxamillion/.local/share/openjkdf2-cds" LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 -- -enhancedCogVerbs #-- -verboseNetworking
LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log detect_leaks=0" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 #-- -verboseNetworking
LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log detect_leaks=0" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 #-- -dedicatedServer -episode "JK1" -map "01narshadda.jkl" #-- -autostart -sp -episode "JK1" -map "01narshadda.jkl" #-- -verboseNetworking
#lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64
#open OpenJKDF2.app

Expand Down
6 changes: 3 additions & 3 deletions cmake_modules/target_macos_all.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ macro(postcompile_macos)
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/zlib/*/*/libz.1.dylib ${BUNDLE}/Contents/MacOS
COMMAND install_name_tool -change libz.1.dylib @executable_path/libz.1.dylib ${BUNDLE}/Contents/MacOS/${BIN_NAME}

COMMAND install_name_tool -change ${HOMEBREW_PREFIX}/opt/openssl@1.1/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib ${BUNDLE}/Contents/MacOS/libGameNetworkingSockets.dylib
COMMAND install_name_tool -change ${HOMEBREW_PREFIX}/opt/openssl@1.1/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib ${BUNDLE}/Contents/MacOS/${BIN_NAME}
COMMAND cp ${HOMEBREW_PREFIX}/opt/openssl@1.1/lib/libcrypto.1.1.dylib ${BUNDLE}/Contents/MacOS
COMMAND install_name_tool -change ${HOMEBREW_PREFIX}/opt/openssl@3/lib/libcrypto.3.dylib @executable_path/libcrypto.3.dylib ${BUNDLE}/Contents/MacOS/libGameNetworkingSockets.dylib
COMMAND install_name_tool -change ${HOMEBREW_PREFIX}/opt/openssl@3/lib/libcrypto.3.dylib @executable_path/libcrypto.3.dylib ${BUNDLE}/Contents/MacOS/${BIN_NAME}
COMMAND cp ${HOMEBREW_PREFIX}/opt/openssl@3/lib/libcrypto.3.dylib ${BUNDLE}/Contents/MacOS

COMMAND chmod 774 ${BUNDLE}/Contents/MacOS/*.dylib
COMMAND cp -r ${CMAKE_CURRENT_BINARY_DIR}/openjkdf2-64.dsym ${BUNDLE}/Contents/MacOS/openjkdf2-64.dsym
Expand Down
4 changes: 2 additions & 2 deletions distpkg_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rm -f src/globals.c
mkdir -p build_darwin_x86_64 && pushd build_darwin_x86_64

export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/usr/local/opt/openssl@1.1/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/usr/local/opt/openssl@3/lib/pkgconfig

cmake .. -DPLAT_MACOS_X86_64=true --toolchain $(pwd)/../cmake_modules/toolchain_macos_x86_64.cmake -DCMAKE_OSX_ARCHITECTURES="x86_64" &&
cmake .. -DPLAT_MACOS_X86_64=true --toolchain $(pwd)/../cmake_modules/toolchain_macos_x86_64.cmake -DCMAKE_OSX_ARCHITECTURES="x86_64" &&
Expand All @@ -45,7 +45,7 @@ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD
mkdir -p build_darwin64 && pushd build_darwin64

export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@3/lib/pkgconfig

cmake .. &&
(make -j $(nproc) PROTOBUF || make -j1 PROTOBUF) &&
Expand Down

0 comments on commit 1add937

Please sign in to comment.