COMP: better handling of versioned cmake libraries

- sentinel was not working properly when building user-space routines
This commit is contained in:
Mark Olesen
2018-01-31 08:35:56 +01:00
parent e27e566345
commit e2332d6bd2
4 changed files with 33 additions and 30 deletions

View File

@ -1,14 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Optional unit: continue-on-error
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Source CMake functions
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions
cd ${0%/*} || exit 1 # Run from this directory
export WM_CONTINUE_ON_ERROR=true # Optional unit
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # Parse arguments
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
# -----------------------------------------------------------------------------

View File

@ -46,21 +46,34 @@ then
exit 1
fi
for cmd in etags ctags-exuberant
unset etags
for cmd in ctags-exuberant etags
do
type $cmd >/dev/null 2>&1 || {
echo "${0##*/} cannot build tag files: '$cmd' command not found"
exit 1
}
command -v $cmd >/dev/null 2>&1 && { etags=$cmd; break; }
done
[ -n "$etags" ] || {
exec 1>&2
echo "${0##*/} cannot build tag files: no suitable command found"
echo " No ctags-exuberant"
echo " No etags"
exit 1
}
case "$etags" in
ctags-exuberant)
etags="$etags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
;;
etags)
etags="$etags --declarations -l c++ -o .tags/etags -"
;;
esac
cd $WM_PROJECT_DIR || exit 1
mkdir .tags 2>/dev/null
#etagsCmd="etags --declarations -l c++ -o .tags/etags -"
etagsCmd="ctags-exuberant -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsCmd
echo "building tags..." 1>&2
find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etags
#gtags -i --gtagsconf bin/tools/gtagsrc .tags

View File

@ -1,8 +1,6 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source CMake functions
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
# -----------------------------------------------------------------------------
@ -23,7 +21,7 @@ if [ -n "$depend" ]
then
if [ "$targetType" != objects ]
then
if type cmake > /dev/null 2>&1
if command -v cmake > /dev/null 2>&1
then
cmakeVersioned "$depend" $PWD || {
echo

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -100,11 +100,9 @@ cmakeVersioned()
sentinel=$(sameDependency "$depend" "$sourceDir") || \
rm -rf "$objectsDir" > /dev/null 2>&1
mkdir -p $objectsDir && \
(
cd $objectsDir && _cmake $sourceDir && make \
&& echo "$depend" > ${sentinel:-/dev/null}
)
mkdir -p $objectsDir \
&& (cd $objectsDir && _cmake $sourceDir && make) \
&& echo "$depend" >| "${sentinel:-/dev/null}"
}