aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-12-06 11:09:42 -0500
committerJack Lloyd <[email protected]>2019-12-06 11:12:13 -0500
commit50031a55e3d3135b805078c0228ef88f68e7e063 (patch)
tree06311c3013f84de05dd9cca4ec6474fc5b930095 /src/scripts
parenteb430d47ec38e806c6e88e45b53d02dcb3b2668b (diff)
Enable warnings-as-errors build in MSVC
Except 2015 which has some weird false positives. Closes #2211
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/ci/appveyor.yml3
-rw-r--r--src/scripts/ci/travis.yml4
-rwxr-xr-xsrc/scripts/ci_build.py12
3 files changed, 13 insertions, 6 deletions
diff --git a/src/scripts/ci/appveyor.yml b/src/scripts/ci/appveyor.yml
index b323a1f6d..f207420d7 100644
--- a/src/scripts/ci/appveyor.yml
+++ b/src/scripts/ci/appveyor.yml
@@ -26,6 +26,7 @@ environment:
BOOST_SYSTEM_LIBRARY: "libboost_system-vc140-mt-x32-1_69.lib"
MAKE_TOOL: nmake
TARGET_CC: msvc
+ EXTRA_FLAGS: "--disable-werror"
# MSVC 2017 DLL x86-32
- CC: VC2017
@@ -80,7 +81,7 @@ install:
- call src\scripts\ci\setup_appveyor.bat
build_script:
- - python src\scripts\ci_build.py --os=windows --cc=%TARGET_CC% --without-python3 --compiler-cache=sccache --make-tool=%MAKE_TOOL% --cpu=%PLATFORM% %TARGET%
+ - python src\scripts\ci_build.py --os=windows --cc=%TARGET_CC% --without-python3 --compiler-cache=sccache --make-tool=%MAKE_TOOL% --cpu=%PLATFORM% %EXTRA_FLAGS% %TARGET%
# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
branches:
diff --git a/src/scripts/ci/travis.yml b/src/scripts/ci/travis.yml
index 7f7e3bb27..844988cc3 100644
--- a/src/scripts/ci/travis.yml
+++ b/src/scripts/ci/travis.yml
@@ -5,6 +5,7 @@ sudo: required
env:
global:
- CCACHE_MAXSIZE=1G
+ - PKCS11_LIB=/usr/lib/softhsm/libsofthsm2.so
jobs:
include:
@@ -129,6 +130,7 @@ jobs:
compiler: gcc
env:
- TARGET="gcc4.8"
+ - EXTRA_FLAGS="--disable-werror"
- os: linux
dist: bionic
@@ -169,7 +171,7 @@ install:
- ./src/scripts/ci/setup_travis.sh
script:
- - ./src/scripts/ci_build.py --os=$TRAVIS_OS_NAME --cc=$CC --cc-bin=$CXX --without-pylint3 --pkcs11-lib=/usr/lib/softhsm/libsofthsm2.so $TARGET
+ - ./src/scripts/ci_build.py --os=$TRAVIS_OS_NAME --cc=$CC --cc-bin=$CXX --without-pylint3 --pkcs11-lib=$PKCS11_LIB $EXTRA_FLAGS $TARGET
# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
branches:
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index b212f33bc..6a209faf1 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -26,7 +26,8 @@ def get_concurrency():
except ImportError:
return def_concurrency
-def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, root_dir, pkcs11_lib, use_gdb):
+def determine_flags(target, target_os, target_cpu, target_cc, cc_bin,
+ ccache, root_dir, pkcs11_lib, use_gdb, disable_werror):
# pylint: disable=too-many-branches,too-many-statements,too-many-arguments,too-many-locals
"""
@@ -70,7 +71,7 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
'--os=%s' % (target_os)]
build_targets = ['cli', 'tests']
- if target_cc in ['gcc', 'clang'] and target != 'gcc4.8':
+ if not disable_werror:
flags += ['--werror-mode']
if target_cpu is not None:
@@ -383,6 +384,9 @@ def parse_args(args):
parser.add_option('--without-pylint3', dest='use_pylint3', action='store_false',
help='Disable using python3 pylint')
+ parser.add_option('--disable-werror', action='store_true', default=False,
+ help='Allow warnings to compile')
+
parser.add_option('--run-under-gdb', dest='use_gdb', action='store_true', default=False,
help='Run test suite under gdb and capture backtrace')
@@ -399,7 +403,7 @@ def have_prog(prog):
return False
def main(args=None):
- # pylint: disable=too-many-branches,too-many-statements,too-many-locals,too-many-return-statements
+ # pylint: disable=too-many-branches,too-many-statements,too-many-locals,too-many-return-statements,too-many-locals
"""
Parse options, do the things
"""
@@ -507,7 +511,7 @@ def main(args=None):
config_flags, run_test_command, make_prefix = determine_flags(
target, options.os, options.cpu, options.cc,
options.cc_bin, options.compiler_cache, root_dir,
- options.pkcs11_lib, options.use_gdb)
+ options.pkcs11_lib, options.use_gdb, options.disable_werror)
cmds.append([py_interp, os.path.join(root_dir, 'configure.py')] + config_flags)