Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow shortcutting builds #5176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions o2physics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ build_requires:
- CMake
- ninja
- alibuild-recipe-tools
- alibuild-variant-support
source: https://github.com/AliceO2Group/O2Physics
incremental_recipe: |
[[ $ALIBUILD_O2PHYSICS_TESTS ]] && CXXFLAGS="${CXXFLAGS} -Werror -Wno-error=deprecated-declarations"
cmake --build . -- ${JOBS:+-j$JOBS} install
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles
case $ALIBUILD_BUILD_VARIANT in
tutorial) TARGET=Tutorials ;;
*) TARGET=$ALIBUILD_BUILD_VARIANT ;;
esac
# In case a variant is passed, we invoke the build with the variant as target
alibuild-variant-command ${ALIBUILD_BUILD_VARIANT:-none} cmake --build . -- ${JOBS:+-j$JOBS} $ALIBUILD_BUILD_VARIANT/install
# No need to continue in case we are using a variant
alibuild-variant-done ${ALIBUILD_BUILD_VARIANT:-none}
cmake --build . -- ${JOBS:+-j$JOBS} install
---
#!/bin/sh

Expand All @@ -38,7 +47,6 @@ cmake "$SOURCEDIR" "-DCMAKE_INSTALL_PREFIX=$INSTALLROOT" \
${FASTJET_ROOT:+-Dfjcontrib_ROOT="$FASTJET_ROOT"} \
${LIBJALIENO2_ROOT:+-DlibjalienO2_ROOT=$LIBJALIENO2_ROOT} \
${LIBUV_ROOT:+-DLibUV_ROOT=$LIBUV_ROOT}
cmake --build . -- ${JOBS+-j $JOBS} install

# export compile_commands.json in (taken from o2.sh)
DEVEL_SOURCES="`readlink $SOURCEDIR || echo $SOURCEDIR`"
Expand All @@ -58,3 +66,16 @@ setenv O2PHYSICS_ROOT \$O2PHYSICS_ROOT
prepend-path ROOT_INCLUDE_PATH \$O2PHYSICS_ROOT/include
EoF
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles

# Better naming for some of the the targets
case $ALIBUILD_BUILD_VARIANT in
tutorial) TARGET=Tutorials ;;
*) TARGET=$ALIBUILD_BUILD_VARIANT ;;
esac

source $ALIBUILD_VARIANT_SUPPORT
# In case a variant is passed, we invoke the build with the variant as target
alibuild-variant-command ${ALIBUILD_BUILD_VARIANT:-none} cmake --build . -- ${JOBS:+-j$JOBS} $TARGET/install
# No need to continue in case we are using a variant
alibuild-variant-done ${ALIBUILD_BUILD_VARIANT:-none}
cmake --build . -- ${JOBS+-j $JOBS} install