diff --git a/.github/workflows/bsd.yaml b/.github/workflows/bsd.yaml index 7c4485e8a3b5..324ffe510ebf 100644 --- a/.github/workflows/bsd.yaml +++ b/.github/workflows/bsd.yaml @@ -48,7 +48,7 @@ jobs: echo "Print ccache stats" ccache -s echo "Checking completeness of help output" - scripts/check_help.sh + scripts/check_help.sh clang++ echo "Run unit tests" gmake -C unit test # gmake -C jbmc/unit test diff --git a/.github/workflows/pull-request-checks.yaml b/.github/workflows/pull-request-checks.yaml index af7b5d0ddc14..1467ec99c0e8 100644 --- a/.github/workflows/pull-request-checks.yaml +++ b/.github/workflows/pull-request-checks.yaml @@ -59,7 +59,7 @@ jobs: - name: Print ccache stats run: ccache -s - name: Checking completeness of help output - run: scripts/check_help.sh + run: scripts/check_help.sh g++ - name: Run unit tests run: | make -C unit test IPASIR=$PWD/riss.git/riss @@ -247,7 +247,7 @@ jobs: - name: Print ccache stats run: ccache -s - name: Checking completeness of help output - run: scripts/check_help.sh build/bin + run: scripts/check_help.sh /usr/bin/g++ build/bin - name: Check if package building works run: | cd build diff --git a/scripts/bash-autocomplete/extract_switches.sh b/scripts/bash-autocomplete/extract_switches.sh index a20d43a5d5f3..f52f1779c475 100755 --- a/scripts/bash-autocomplete/extract_switches.sh +++ b/scripts/bash-autocomplete/extract_switches.sh @@ -2,15 +2,18 @@ set -e +CXX=$1 +shift + # make sure we execute the remainder in the directory containing this script cd `dirname $0` echo "Compiling the helper file to extract the raw list of parameters from cbmc" -g++ -E -dM -std=c++17 -I../../src ../../src/cbmc/cbmc_parse_options.cpp -o macros.c +$CXX -E -dM -std=c++17 -I../../src ../../src/cbmc/cbmc_parse_options.cpp -o macros.c echo CBMC_OPTIONS >> macros.c echo "Converting the raw parameter list to the format required by autocomplete scripts" -rawstring="`gcc -E -P -w macros.c` \"?h(help)\"" +rawstring="`$CXX -E -P -w macros.c` \"?h(help)\"" rm macros.c #now the main bit, convert from raw format to a proper list of switches diff --git a/scripts/check_help.sh b/scripts/check_help.sh index dbdcf3c9ac75..2a7fb7ae6d02 100755 --- a/scripts/check_help.sh +++ b/scripts/check_help.sh @@ -2,6 +2,9 @@ set -e +CXX=$1 +shift + # if a command-line argument is provided, use it as a path to built binaries # (CMake-style build); otherwise assume we use Makefile-based in-tree build if [ $# -eq 1 ] ; then @@ -33,10 +36,10 @@ for t in \ tool_name=$(basename $t) opt_name=$(echo $tool_name | tr 'a-z-' 'A-Z_') echo "Extracting the raw list of parameters from $tool_name" - g++ -E -dM -std=c++17 -I../src -I../jbmc/src $t/*_parse_options.cpp -o macros.c + $CXX -E -dM -std=c++17 -I../src -I../jbmc/src $t/*_parse_options.cpp -o macros.c # goto-analyzer partly uses the spelling "analyser" within the code base echo ${opt_name}_OPTIONS | sed 's/GOTO_ANALYZER/GOTO_ANALYSER/' >> macros.c - rawstring="`gcc -E -P -w macros.c` \"?h(help)\"" + rawstring="`$CXX -E -P -w macros.c` \"?h(help)\"" rm macros.c # now the main bit, convert from raw format to a proper list of switches diff --git a/src/cbmc/CMakeLists.txt b/src/cbmc/CMakeLists.txt index 3086b19366cf..97560d70b573 100644 --- a/src/cbmc/CMakeLists.txt +++ b/src/cbmc/CMakeLists.txt @@ -59,7 +59,7 @@ endif() # bash completion if(NOT WIN32) add_custom_command(OUTPUT "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh" - COMMAND "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" + COMMAND "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}" DEPENDS $ ) add_custom_target(cbmc.sh ALL