Skip to content

Commit 7bb0be7

Browse files
committed
fixed #14065 - Makefile: added CXXOPTS and LDOPTS to extend CXXFLAGS and LDFLAGS [skip ci]
1 parent 4aa87ff commit 7bb0be7

19 files changed

+65
-71
lines changed

.github/workflows/CI-mingw.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,19 @@ jobs:
5858
run: |
5959
export PATH="/mingw64/lib/ccache/bin:$PATH"
6060
# set RDYNAMIC to work around broken MinGW detection
61-
make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) cppcheck
62-
env:
63-
LDFLAGS: -fuse-ld=lld # use lld for faster linking
61+
# use lld for faster linking
62+
make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) cppcheck
6463
6564
- name: Build test
6665
run: |
6766
export PATH="/mingw64/lib/ccache/bin:$PATH"
6867
# set RDYNAMIC to work around broken MinGW detection
69-
make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) testrunner
70-
env:
71-
LDFLAGS: -fuse-ld=lld # use lld for faster linking
68+
# use lld for faster linking
69+
make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) testrunner
7270
7371
- name: Run test
7472
run: |
7573
export PATH="/mingw64/lib/ccache/bin:$PATH"
7674
# set RDYNAMIC to work around broken MinGW detection
77-
make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) check
78-
env:
79-
LDFLAGS: -fuse-ld=lld # use lld for faster linking
75+
# use lld for faster linking
76+
make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) check

.github/workflows/CI-unixish-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ jobs:
113113
- name: Build cppcheck
114114
run: |
115115
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
116-
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
116+
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-w"
117117
118118
- name: Build test
119119
run: |
120120
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
121-
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
121+
make -j$(nproc) testrunner HAVE_RULES=yes CXXOPTS="-w"
122122
123123
- name: Run test
124124
run: |

.github/workflows/CI-unixish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ jobs:
179179
- name: Build with Unsigned char
180180
run: |
181181
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
182-
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
182+
make -j$(nproc) CXXOPTS=-funsigned-char testrunner
183183
184184
- name: Test with Unsigned char
185185
run: |
@@ -569,7 +569,7 @@ jobs:
569569
run: |
570570
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
571571
# compile with verification and ast matchers
572-
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
572+
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXOPTS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
573573
574574
- name: CMake
575575
run: |

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Compile instrumented
4444
run: |
4545
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
46-
make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
46+
make -j$(nproc) all CXXOPTS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
4747
4848
- name: Run instrumented tests
4949
run: |

.github/workflows/cppcheck-premium.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
tar xzvf cppcheckpremium.tar.gz
5050
mv cppcheckpremium-devdrop-20250713 cppcheckpremium
5151
# Overwrite cppcheck binary
52-
make -j$(nproc) CXXFLAGS=-O2 MATCHCOMPILER=yes
52+
make -j$(nproc) CXXOPTS=-O2 MATCHCOMPILER=yes
5353
cp cppcheck cppcheckpremium/
5454
5555
- name: Generate a license file

.github/workflows/scriptcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: build cppcheck
4040
run: |
4141
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
42-
make -j$(nproc) -s CXXFLAGS="-w"
42+
make -j$(nproc) -s CXXOPTS="-w"
4343
strip -s ./cppcheck
4444
4545
scriptcheck:
@@ -215,7 +215,7 @@ jobs:
215215

216216
- name: run dmake
217217
run: |
218-
make -j3 CXXFLAGS="-w" run-dmake
218+
make -j3 CXXOPTS="-w" run-dmake
219219
220220
- name: check diff
221221
run: |

.github/workflows/selfcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
5757
# valgrind cannot handle DWARF 5 yet so force version 4
5858
# work around performance regression with -inline-deferral
59-
make -j$(nproc) -s CXXFLAGS="-O2 -w -DHAVE_BOOST -gdwarf-4 -mllvm -inline-deferral" MATCHCOMPILER=yes
59+
make -j$(nproc) -s CXXOPTS="-O2 -w -DHAVE_BOOST -gdwarf-4 -mllvm -inline-deferral" MATCHCOMPILER=yes
6060
env:
6161
CC: clang-14
6262
CXX: clang++-14

.github/workflows/valgrind.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ jobs:
4141
- name: Build cppcheck
4242
run: |
4343
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
44-
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes
44+
CXXOPTS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes
4545
4646
- name: Build test
4747
run: |
4848
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
49-
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes
49+
CXXOPTS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes
5050
5151
- name: Run valgrind
5252
run: |

createrelease

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# - ensure cfg files etc are included (win_installer/cppcheck.wxs)
2727
#
2828
# self check, fix critical issues:
29-
# make clean && make CXXFLAGS=-O2 MATCHCOMPILER=yes -j4
29+
# make clean && make CXXOPTS=-O2 MATCHCOMPILER=yes -j4
3030
# ./cppcheck -D__CPPCHECK__ -D__GNUC__ -DCHECK_INTERNAL -DHAVE_RULES --std=c++11 --library=cppcheck-lib --library=qt --enable=style --inconclusive --inline-suppr --suppress=bitwiseOnBoolean --suppress=shadowFunction --suppress=useStlAlgorithm --suppress=*:externals/picojson.h --suppress=functionConst --suppress=functionStatic --suppress=normalCheckLevelMaxBranches --xml cli gui/*.cpp lib 2> selfcheck.xml
3131
#
3232
# Generate lib/checkers.cpp (TODO the premium checkers should not be statically coded)
@@ -155,7 +155,7 @@ cp -R ~/cppcheck/cfg .
155155
cp -R ~/cppcheck/addons .
156156
cp -R ~/cppcheck/platforms .
157157
cd ~/cppcheck
158-
make clean ; make -j12 FILESDIR=~/.cppcheck/$tag MATCHCOMPILER=yes CXXFLAGS=-O2
158+
make clean ; make -j12 FILESDIR=~/.cppcheck/$tag MATCHCOMPILER=yes CXXOPTS=-O2
159159
mv cppcheck ~/.cppcheck/cppcheck-$tag
160160

161161
git checkout main

generate_coverage_report

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33
make clean
44
rm -rf coverage_report
5-
make test CXXFLAGS="-g -fprofile-arcs -ftest-coverage"
5+
make test CXXOPTS="-g -fprofile-arcs -ftest-coverage"
66
test/cfg/runtests.sh
77
gcov lib/*.cpp -o lib/
88
lcov --directory ./ --capture --output-file lcov_tmp.info -b ./

0 commit comments

Comments
 (0)