mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: support Allwmake with -bear-output-dir (#3322)
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2014-2017 OpenFOAM Foundation
|
# Copyright (C) 2014-2017 OpenFOAM Foundation
|
||||||
# Copyright (C) 2019-2023 OpenCFD Ltd.
|
# Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -43,7 +43,7 @@
|
|||||||
# -prefix=... same as -module-prefix=...
|
# -prefix=... same as -module-prefix=...
|
||||||
#
|
#
|
||||||
# Trapped options
|
# Trapped options
|
||||||
# -with-bear
|
# -with-bear, -bear-output-dir
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Check environment
|
# Check environment
|
||||||
@ -88,7 +88,7 @@ USAGE
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset wmakeOpt_frontend wmakeOpt_nonRecursive
|
unset wmakeOpt_frontend wmakeOpt_frontend_arg wmakeOpt_nonRecursive
|
||||||
unset wmakeOpt_debug wmakeOpt_log wmakeOpt_openmp wmakeOpt_strict wmakeOpt_queue
|
unset wmakeOpt_debug wmakeOpt_log wmakeOpt_openmp wmakeOpt_strict wmakeOpt_queue
|
||||||
|
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
@ -97,6 +97,8 @@ do
|
|||||||
shift
|
shift
|
||||||
|
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
|
('') continue ;; # Empty argument, ignore it
|
||||||
|
|
||||||
-h | -help*)
|
-h | -help*)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
@ -107,6 +109,14 @@ do
|
|||||||
continue # Argument handled, remove it
|
continue # Argument handled, remove it
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-bear-output-dir=*)
|
||||||
|
# Implies '-with-bear' as frontend wrapper,
|
||||||
|
# so ensure that that is indeed also set
|
||||||
|
: "${wmakeOpt_frontend:=-with-bear}"
|
||||||
|
wmakeOpt_frontend_arg="$arg"
|
||||||
|
continue # Argument handled, remove it
|
||||||
|
;;
|
||||||
|
|
||||||
-no-recurs* | -fromWmake)
|
-no-recurs* | -fromWmake)
|
||||||
# Avoid recursion (eg, if called from wmake)
|
# Avoid recursion (eg, if called from wmake)
|
||||||
wmakeOpt_nonRecursive=true
|
wmakeOpt_nonRecursive=true
|
||||||
@ -214,13 +224,13 @@ if [ -z "$wmakeOpt_nonRecursive" ]
|
|||||||
then
|
then
|
||||||
if [ -z "$wmakeOpt_log" ]
|
if [ -z "$wmakeOpt_log" ]
|
||||||
then
|
then
|
||||||
exec wmake $wmakeOpt_frontend -all \
|
exec wmake $wmakeOpt_frontend "$wmakeOpt_frontend_arg" -all \
|
||||||
$wmakeOpt_debug $wmakeOpt_strict $wmakeOpt_queue $wmakeOpt_openmp $*
|
$wmakeOpt_debug $wmakeOpt_strict $wmakeOpt_queue $wmakeOpt_openmp $*
|
||||||
exit $? # Unneeded, but just in case something went wrong
|
exit $? # Unneeded, but just in case something went wrong
|
||||||
else
|
else
|
||||||
echo "Logging wmake -all output to '$wmakeOpt_log'" 1>&2
|
echo "Logging wmake -all output to '$wmakeOpt_log'" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
exec wmake $wmakeOpt_frontend -all \
|
exec wmake $wmakeOpt_frontend "$wmakeOpt_frontend_arg" -all \
|
||||||
$wmakeOpt_debug $wmakeOpt_strict $wmakeOpt_queue $wmakeOpt_openmp $* 2>&1 | \
|
$wmakeOpt_debug $wmakeOpt_strict $wmakeOpt_queue $wmakeOpt_openmp $* 2>&1 | \
|
||||||
/usr/bin/tee $wmakeOpt_log
|
/usr/bin/tee $wmakeOpt_log
|
||||||
# Need to cleanup after the tee
|
# Need to cleanup after the tee
|
||||||
@ -245,7 +255,7 @@ fi
|
|||||||
# Cleanup local variables and functions
|
# Cleanup local variables and functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset wmakeOpt_frontend wmakeOpt_nonRecursive
|
unset wmakeOpt_frontend wmakeOpt_frontend_arg wmakeOpt_nonRecursive
|
||||||
unset wmakeOpt_debug wmakeOpt_log wmakeOpt_openmp wmakeOpt_strict wmakeOpt_queue
|
unset wmakeOpt_debug wmakeOpt_log wmakeOpt_openmp wmakeOpt_strict wmakeOpt_queue
|
||||||
unset -f usage
|
unset -f usage
|
||||||
|
|
||||||
|
|||||||
@ -125,7 +125,7 @@ setOutput()
|
|||||||
|
|
||||||
mkdir -p "$outputDir"
|
mkdir -p "$outputDir"
|
||||||
outputFile="$outputDir/compile_commands.json"
|
outputFile="$outputDir/compile_commands.json"
|
||||||
echo "Output = $outputFile" 1>&2
|
echo "Output = '$outputFile'" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user