From 6f812233d2000b0cec47ea47548db54fbe0f7341 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 24 Jun 2022 13:51:31 +0300 Subject: [PATCH 1/2] Don't set -march=native and -Werror by default See https://amdmi3.ru/posts/packaging-friendliness-compiler-flags-to-avoid/ --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 004eb426..f37f5bde 100644 --- a/Makefile +++ b/Makefile @@ -81,24 +81,23 @@ endif ifeq (${TOOLCHAIN},clang) CXXFLAGS_STD = -std=c++11 - CXXFLAGS_EARLY += -march=native -fPIC - CXXFLAGS_EARLY += -W -Wall -Wextra -Wsuggest-override -Werror -pedantic + CXXFLAGS_EARLY += -fPIC + CXXFLAGS_EARLY += -W -Wall -Wextra -Wsuggest-override -pedantic CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-unknown-warning-option CXXFLAGS_EARLY += -Wno-invalid-offsetof endif ifeq (${TOOLCHAIN},gcc) CXXFLAGS_STD = -std=c++11 - CXXFLAGS_EARLY += -march=native -fPIC - CXXFLAGS_EARLY += -W -Wall -Wextra -Werror -pedantic + CXXFLAGS_EARLY += -fPIC + CXXFLAGS_EARLY += -W -Wall -Wextra -pedantic CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized CXXFLAGS_EARLY += -Wno-invalid-offsetof endif ifeq (${TOOLCHAIN},mingw) CXXFLAGS_STD = -std=c++11 - CXXFLAGS_EARLY += -march=native - CXXFLAGS_EARLY += -W -Wall -Wextra -Werror + CXXFLAGS_EARLY += -W -Wall -Wextra CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized CXXFLAGS_EARLY += -Wno-invalid-offsetof endif From b7975f20ce0842893dfc068ef9f66c3e43dfd59a Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 29 Jun 2022 21:58:11 +0300 Subject: [PATCH 2/2] Enable -Werror for CI --- .github/workflows/build.sh | 1 + .travis.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index 0d4afab3..5dfa741e 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -17,6 +17,7 @@ fi export CC=$GH_COMPILER export CXX=${CC%cc}++ +export CXXFLAGS_EARLY=-Werror if [[ "$GH_BUILDSYS" == "makefile" ]]; then make diff --git a/.travis.yml b/.travis.yml index 95516a05..6c8e9887 100644 --- a/.travis.yml +++ b/.travis.yml @@ -162,6 +162,7 @@ script: fi - |- # Build hyperrogue. + export CXXFLAGS_EARLY=-Werror if [[ "$TRAVIS_BUILD_SYSTEM" == "Makefile" ]]; then make elif [[ "$TRAVIS_BUILD_SYSTEM" == "mymake" ]]; then