Skip to content

Commit

Permalink
Merge pull request #20960 from cbjeukendrup/vtests_debug
Browse files Browse the repository at this point in the history
VTests: build in debug mode
  • Loading branch information
cbjeukendrup committed Jan 11, 2024
2 parents cfd3da6 + 3e95868 commit ff19fec
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
4 changes: 2 additions & 2 deletions build/ci/vtests/build_and_pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trap 'echo Build failed; exit 1' ERR

BUILD_TOOLS=$HOME/build_tools
ARTIFACTS_DIR=build.artifacts
BUILD_DIR=build.release
BUILD_DIR=build.debug
INSTALL_DIR=build.install

cat $BUILD_TOOLS/environment.sh
Expand All @@ -41,7 +41,7 @@ bash ninja_build.sh -t clean

MUSESCORE_BUILD_CONFIGURATION="vtest" \
MUSESCORE_REVISION=$MUSESCORE_REVISION \
bash ninja_build.sh -t appimage
bash ninja_build.sh -t appimagedebug

bash ./build/ci/tools/make_release_channel_env.sh -c $BUILD_MODE
bash ./build/ci/tools/make_version_env.sh $BUILD_NUMBER
Expand Down
53 changes: 37 additions & 16 deletions ninja_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ MUSESCORE_VST3_SDK_PATH=${MUSESCORE_VST3_SDK_PATH:-""}
MUSESCORE_DOWNLOAD_SOUNDFONT=${MUSESCORE_DOWNLOAD_SOUNDFONT:-"ON"}
MUSESCORE_BUILD_UNIT_TESTS=${MUSESCORE_BUILD_UNIT_TESTS:-"OFF"}
MUSESCORE_NO_RPATH=${MUSESCORE_NO_RPATH:-"OFF"}
MUSESCORE_YOUTUBE_API_KEY=${MUSESCORE_YOUTUBE_API_KEY:-""}
MUSESCORE_YOUTUBE_API_KEY=${MUSESCORE_YOUTUBE_API_KEY:-""}
MUSESCORE_BUILD_UPDATE_MODULE=${MUSESCORE_BUILD_UPDATE_MODULE:-"ON"}
MUSESCORE_BUILD_VST_MODULE=${MUSESCORE_BUILD_VST_MODULE:-"OFF"}
MUSESCORE_BUILD_VIDEOEXPORT_MODULE=${MUSESCORE_BUILD_VIDEOEXPORT_MODULE:-"OFF"}
Expand Down Expand Up @@ -100,7 +100,7 @@ function do_build() {
-DCMAKE_SKIP_RPATH="${MUSESCORE_NO_RPATH}" \


ninja -j $JOBS
ninja -j $JOBS
}


Expand All @@ -110,7 +110,7 @@ case $TARGET in
mkdir -p build.release
cd build.release
do_build Release
;;
;;

debug)
mkdir -p build.debug
Expand All @@ -122,7 +122,7 @@ case $TARGET in
mkdir -p build.release
cd build.release
do_build RelWithDebInfo
;;
;;

install)
mkdir -p build.release
Expand All @@ -136,19 +136,19 @@ case $TARGET in
cd build.release
do_build RelWithDebInfo
ninja install
;;
;;

installdebug)
mkdir -p build.debug
cd build.debug
do_build Debug
ninja install
;;
;;

clean)
rm -rf build.debug build.release
;;
;;

compile_commands)
# Generate compile_commands.json file (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
mkdir -p build.tooldata
Expand All @@ -175,38 +175,59 @@ case $TARGET in
-DMUE_LOGGER_DEBUGLEVEL_ENABLED="${MUSESCORE_DEBUGLEVEL_ENABLED}" \
-DVST3_SDK_PATH="${MUSESCORE_VST3_SDK_PATH}" \
-DCMAKE_SKIP_RPATH="${MUSESCORE_NO_RPATH}" \


;;

revision)
git rev-parse --short=7 HEAD | tr -d '\n' > local_build_revision.env
;;

appimage)
MUSESCORE_INSTALL_DIR=../MuseScore
MUSESCORE_INSTALL_DIR=../MuseScore
MUSESCORE_INSTALL_SUFFIX="4portable${MUSESCORE_INSTALL_SUFFIX}" # e.g. "4portable" or "4portablenightly"
MUSESCORE_NO_RPATH=ON
MUSESCORE_NO_RPATH=ON

mkdir -p build.release
cd build.release
do_build RELEASE
ninja install

build_dir="$(pwd)"
install_dir="$(cat $build_dir/PREFIX.txt)"
build_dir="$(pwd)"
install_dir="$(cat $build_dir/PREFIX.txt)"
cd $install_dir

ln -sf . usr # we installed into the root of our AppImage but some tools expect a "usr" subdirectory
mscore="mscore${MUSESCORE_INSTALL_SUFFIX}"
desktop="org.musescore.MuseScore${MUSESCORE_INSTALL_SUFFIX}.desktop"
icon="${mscore}.png"
mani="install_manifest.txt"
mani="install_manifest.txt"
cp "share/applications/${desktop}" "${desktop}"
cp "share/icons/hicolor/128x128/apps/${icon}" "${icon}"
<"$build_dir/${mani}" >"${mani}" sed -rn 's/.*(share\/)(applications|icons|man|metainfo|mime)(.*)/\1\2\3/p'
;;

appimagedebug)
MUSESCORE_INSTALL_DIR=../MuseScore
MUSESCORE_INSTALL_SUFFIX="4portable${MUSESCORE_INSTALL_SUFFIX}" # e.g. "4portable" or "4portablenightly"
MUSESCORE_NO_RPATH=ON

mkdir -p build.debug
cd build.debug
do_build Debug
ninja install

;;
build_dir="$(pwd)"
install_dir="$(cat $build_dir/PREFIX.txt)"
cd $install_dir

ln -sf . usr # we installed into the root of our AppImage but some tools expect a "usr" subdirectory
mscore="mscore${MUSESCORE_INSTALL_SUFFIX}"
desktop="org.musescore.MuseScore${MUSESCORE_INSTALL_SUFFIX}.desktop"
icon="${mscore}.png"
mani="install_manifest.txt"
cp "share/applications/${desktop}" "${desktop}"
cp "share/icons/hicolor/128x128/apps/${icon}" "${icon}"
<"$build_dir/${mani}" >"${mani}" sed -rn 's/.*(share\/)(applications|icons|man|metainfo|mime)(.*)/\1\2\3/p'
;;

*)
echo "Unknown target: $TARGET";
Expand Down

0 comments on commit ff19fec

Please sign in to comment.