-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable universal build as default, add arm64-only build for macOS
- Loading branch information
1 parent
bfd3b93
commit bf343ce
Showing
5 changed files
with
65 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
option('build_exe', type : 'boolean', value : true, description : 'Build executable') | ||
option('build_test', type : 'boolean', value : false, description : 'Build tests') | ||
option('macosx_version_min', type : 'string', value : '10.9', | ||
description : 'Deployment target for macOS. This will affect to subprojects') | ||
description : 'Deployment target for macOS.') | ||
option('macosx_universal', type : 'boolean', value : false, | ||
description : 'Build universal binary for macOS.') | ||
option('use_ucrt', type : 'boolean', value : false, | ||
description : 'Use Universal CRT for Windows 10 or later') | ||
description : 'Use dynamic linked UCRT for Windows 10 or later') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# Build an universal binary for macOS. | ||
# Tuw will be generated in ../build/${build_type} | ||
|
||
# You can specify build type as an argument like "bash build_universal.sh Debug" | ||
if [ "$1" = "Debug" ]; then | ||
build_type="Debug" | ||
preset="--native-file presets/debug.ini" | ||
else | ||
build_type="Release" | ||
preset="--native-file presets/release.ini" | ||
fi | ||
|
||
echo "Build type: ${build_type}" | ||
|
||
os=$(uname -s) | ||
options="" | ||
if [[ "$build_type" == "Release" ]]; then | ||
options="-Db_lto=true" | ||
fi | ||
|
||
pushd $(dirname "$0")/.. | ||
meson setup build/${build_type} ${preset} -Dmacosx_universal=true ${options} || exit 1 | ||
cd build/${build_type} | ||
meson compile -v || exit 1 | ||
|
||
# Strip symbols to reduce the binary size | ||
if [ "${build_type}" = "Release" ]; then | ||
if [[ "$os" == "Linux" ]]; then | ||
strip --strip-all ./Tuw | ||
elif [[ "$os" == "Darwin" ]]; then | ||
strip ./Tuw | ||
fi | ||
fi | ||
popd |