Skip to content

Commit

Permalink
tweak c++ build script to make Mac binaries with cmake/make
Browse files Browse the repository at this point in the history
Signed-off-by: Terence Parr <parrt@antlr.org>
  • Loading branch information
parrt committed Sep 4, 2022
1 parent 3a2053e commit 40e96ba
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions runtime/Cpp/deploy-macos.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#!/bin/bash

# Clean left overs from previous builds if there are any
rm -f -R antlr4-runtime build lib 2> /dev/null
rm antlr4-cpp-runtime-macos.zip 2> /dev/null
rm -rf antlr4-runtime build lib
rm -f antlr4-cpp-runtime-macos.zip

# Binaries
xcodebuild -project runtime/antlrcpp.xcodeproj \
-target antlr4 \
# GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS USE_UTF8_INSTEAD_OF_CODECVT' \
-configuration Release
xcodebuild -project runtime/antlrcpp.xcodeproj \
-target antlr4_static \
# GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS USE_UTF8_INSTEAD_OF_CODECVT' \
-configuration Release
rm -f -R lib
cmake . -D CMAKE_OSX_ARCHITECTURES="arm64; x86_64" -DCMAKE_BUILD_TYPE=Release &> /dev/null
make -j 8

rm -rf lib
mkdir lib
mv runtime/build/Release/libantlr4-runtime.a lib/
mv runtime/build/Release/libantlr4-runtime.dylib lib/
cp runtime/libantlr4-runtime.dylib lib
cp runtime/libantlr4-runtime.a lib

# Headers
rm -f -R antlr4-runtime
Expand Down

0 comments on commit 40e96ba

Please sign in to comment.