mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-27 10:47:41 +00:00
Merge pull request #12496 from keymanapp/chore/mac/mcompile_mac-CommonMesonPatterns
chore(common): consolidate common meson patterns and use 'c++17' in standard.meson.build 🐘
This commit is contained in:
commit
960bbdc74a
4 changed files with 62 additions and 71 deletions
|
|
@ -1 +1 @@
|
|||
18.0.126
|
||||
18.0.126
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/meson-utils.inc.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
#. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
@ -26,38 +27,7 @@ builder_describe_outputs \
|
|||
|
||||
TARGET_PATH="$THIS_SCRIPT_PATH/build"
|
||||
|
||||
do_clean() {
|
||||
rm -rf "$THIS_SCRIPT_PATH/resources"
|
||||
rm -rf "$TARGET_PATH"
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
# Import our standard compiler defines; this is copied from
|
||||
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
|
||||
# allow us to reference a file outside its root
|
||||
mkdir -p "$THIS_SCRIPT_PATH/resources"
|
||||
cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build"
|
||||
|
||||
pushd "$THIS_SCRIPT_PATH" > /dev/null
|
||||
# Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR}
|
||||
meson setup build --buildtype $BUILDER_CONFIGURATION "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
|
||||
}
|
||||
|
||||
do_build() {
|
||||
pushd "$TARGET_PATH" > /dev/null
|
||||
ninja
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
do_test() {
|
||||
pushd "$TARGET_PATH" > /dev/null
|
||||
meson test "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
builder_run_action clean do_clean
|
||||
builder_run_action configure do_configure
|
||||
builder_run_action build do_build
|
||||
builder_run_action test do_test
|
||||
builder_run_action clean do_meson_clean
|
||||
builder_run_action configure do_meson_configure
|
||||
builder_run_action build do_meson_build
|
||||
builder_run_action test do_meson_test
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/meson-utils.inc.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
################################ Main script ################################
|
||||
|
|
@ -24,38 +25,7 @@ builder_describe_outputs \
|
|||
|
||||
TARGET_PATH="$THIS_SCRIPT_PATH/build"
|
||||
|
||||
do_clean() {
|
||||
rm -rf "$THIS_SCRIPT_PATH/resources"
|
||||
rm -rf "$TARGET_PATH"
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
# Import our standard compiler defines; this is copied from
|
||||
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
|
||||
# allow us to reference a file outside its root
|
||||
mkdir -p "$THIS_SCRIPT_PATH/resources"
|
||||
cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build"
|
||||
|
||||
pushd "$THIS_SCRIPT_PATH" > /dev/null
|
||||
# Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR}
|
||||
meson setup build --buildtype $BUILDER_CONFIGURATION "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
|
||||
}
|
||||
|
||||
do_build() {
|
||||
pushd "$TARGET_PATH" > /dev/null
|
||||
ninja
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
do_test() {
|
||||
pushd "$TARGET_PATH" > /dev/null
|
||||
meson test "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
builder_run_action clean do_clean
|
||||
builder_run_action configure do_configure
|
||||
builder_run_action build do_build
|
||||
builder_run_action test do_test
|
||||
builder_run_action clean do_meson_clean
|
||||
builder_run_action configure do_meson_configure
|
||||
builder_run_action build do_meson_build
|
||||
builder_run_action test do_meson_test
|
||||
|
|
|
|||
51
resources/build/meson-utils.inc.sh
Normal file
51
resources/build/meson-utils.inc.sh
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script contains common meson functions
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# clean
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
do_meson_clean() {
|
||||
rm -rf "$THIS_SCRIPT_PATH/resources"
|
||||
rm -rf "$TARGET_PATH"
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# configure
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
do_meson_configure() {
|
||||
# Import our standard compiler defines; this is copied from
|
||||
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
|
||||
# allow us to reference a file outside its root
|
||||
mkdir -p "$THIS_SCRIPT_PATH/resources"
|
||||
cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build"
|
||||
|
||||
pushd "$THIS_SCRIPT_PATH" > /dev/null
|
||||
# Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR}
|
||||
meson setup build --buildtype $BUILDER_CONFIGURATION "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# build
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
do_meson_build() {
|
||||
pushd "$TARGET_PATH" > /dev/null
|
||||
ninja
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# test
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
do_meson_test() {
|
||||
pushd "$TARGET_PATH" > /dev/null
|
||||
meson test "${builder_extra_params[@]}"
|
||||
popd > /dev/null
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue