Skip to content

Commit 3548892

Browse files
committed
ci: switch to pkgconf on Linux too
Change-Id: I056f85a1bf2fdc6167c7c2d39c664b5c32c20b98
1 parent f4571e8 commit 3548892

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

.jenkins.d/00-deps.sh

+12-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@ APT_PKGS=(
1515
libboost-thread-dev
1616
libsqlite3-dev
1717
libssl-dev
18-
pkg-config
18+
pkgconf
1919
python3
2020
)
21+
DNF_PKGS=(
22+
boost-devel
23+
gcc-c++
24+
libasan
25+
lld
26+
openssl-devel
27+
pkgconf
28+
python3
29+
sqlite-devel
30+
)
2131
FORMULAE=(boost openssl pkgconf)
2232
PIP_PKGS=()
2333
case $JOB_NAME in
@@ -45,8 +55,7 @@ elif [[ $ID_LIKE == *debian* ]]; then
4555
sudo apt-get update -qq
4656
sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
4757
elif [[ $ID_LIKE == *fedora* ]]; then
48-
sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
49-
boost-devel openssl-devel sqlite-devel
58+
sudo dnf install -y "${DNF_PKGS[@]}"
5059
fi
5160

5261
if (( ${#PIP_PKGS[@]} )); then

.jenkins.d/40-headers-check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fi
1717

1818
CXX=${CXX:-g++}
1919
STD=-std=c++17
20-
CXXFLAGS="-O2 -Wall -Wno-unknown-warning-option -Wno-enum-constexpr-conversion -Wno-unused-const-variable $(pkg-config --cflags libndn-cxx $PCFILE)"
21-
INCLUDEDIR="$(pkg-config --variable=includedir $PCFILE)"/$PROJ
20+
CXXFLAGS="-O2 -Wall -Wno-unknown-warning-option -Wno-enum-constexpr-conversion -Wno-unused-const-variable $(pkgconf --cflags libndn-cxx $PCFILE)"
21+
INCLUDEDIR="$(pkgconf --variable=includedir $PCFILE)"/$PROJ
2222

2323
echo "Using: $CXX $STD $CXXFLAGS"
2424

.waf-tools/default-compiler-flags.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def configure(conf):
1111
conf.start_msg('Checking C++ compiler version')
1212

1313
cxx = conf.env.CXX_NAME # generic name of the compiler
14-
ccver = tuple(int(i) for i in conf.env.CC_VERSION)
14+
ccver = get_compiler_ver(conf)
1515
ccverstr = '.'.join(conf.env.CC_VERSION)
1616
errmsg = ''
1717
warnmsg = ''
@@ -60,6 +60,10 @@ def configure(conf):
6060
conf.env.DEFINES += generalFlags['DEFINES']
6161

6262

63+
def get_compiler_ver(conf):
64+
return tuple(int(i) for i in conf.env.CC_VERSION)
65+
66+
6367
@Configure.conf
6468
def check_compiler_flags(conf):
6569
# Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -124,9 +128,6 @@ def add_supported_linkflags(self, linkflags):
124128

125129

126130
class CompilerFlags:
127-
def getCompilerVersion(self, conf):
128-
return tuple(int(i) for i in conf.env.CC_VERSION)
129-
130131
def getGeneralFlags(self, conf):
131132
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
132133
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
@@ -227,7 +228,7 @@ def getGeneralFlags(self, conf):
227228
elif Utils.unversioned_sys_platform() == 'freebsd':
228229
# Bug #4790
229230
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
230-
if self.getCompilerVersion(conf) >= (18, 0, 0):
231+
if get_compiler_ver(conf) >= (18, 0, 0) and get_compiler_ver(conf) < (20, 1, 0):
231232
# Bug #5300
232233
flags['CXXFLAGS'] += ['-Wno-enum-constexpr-conversion']
233234
return flags
@@ -241,10 +242,10 @@ def getDebugFlags(self, conf):
241242
flags = super().getDebugFlags(conf)
242243
flags['CXXFLAGS'] += self.__cxxFlags
243244
# Enable assertions in libc++
244-
if self.getCompilerVersion(conf) >= (18, 0, 0):
245+
if get_compiler_ver(conf) >= (18, 0, 0):
245246
# https://libcxx.llvm.org/Hardening.html
246247
flags['DEFINES'] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE']
247-
elif self.getCompilerVersion(conf) >= (15, 0, 0):
248+
elif get_compiler_ver(conf) >= (15, 0, 0):
248249
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
249250
flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
250251
# Tell libc++ to avoid including transitive headers

0 commit comments

Comments
 (0)