Skip to content

Commit

Permalink
turn off Werror by default
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Dec 28, 2023
1 parent 7ddb719 commit f28ce14
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: setup-build
env:
CXX: ${{ matrix.compiler.cxx }}
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_USE_LTO=ON
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_USE_WERROR=ON -DGAPP_USE_LTO=ON

- name: build
run: cmake --build . --parallel 8
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
cxx: $(brew --prefix llvm@14)/bin/clang++,
pkgs: llvm@14 gcc@11,
extra-flags: "-femulated-tls -stdlib=libstdc++ -stdlib++-isystem $(brew --prefix gcc@11)/include/c++/11 -cxx-isystem $(brew --prefix gcc@11)/include/c++/11/x86_64-apple-darwin22",
linker-flags: "-L$(brew --prefix gcc@11)/lib/gcc/11"
linker-flags: "-plugin-opt=-emulated-tls, -L$(brew --prefix gcc@11)/lib/gcc/11"
},
{
cxx: $(brew --prefix llvm@15)/bin/clang++,
pkgs: llvm@15 gcc@12,
extra-flags: "-femulated-tls -stdlib=libstdc++ -stdlib++-isystem $(brew --prefix gcc@12)/include/c++/12 -cxx-isystem $(brew --prefix gcc@12)/include/c++/12/x86_64-apple-darwin22",
linker-flags: "-L$(brew --prefix gcc@12)/lib/gcc/12"
linker-flags: "-plugin-opt=-emulated-tls, -L$(brew --prefix gcc@12)/lib/gcc/12"
}
]

Expand All @@ -44,7 +44,7 @@ jobs:
run: sudo bash ./install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}"

- name: setup-build
run: cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}"
run: cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}" -DGAPP_USE_WERROR=ON -DGAPP_USE_LTO=ON

- name: build
run: cmake --build . --parallel 8
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
matrix:
build-type: [ Release, RelWithDebInfo ]
platform: [ x64, Win32 ]
compiler: [ v143, ClangCL ]
generator: [ "Visual Studio 17 2022" ]
compiler: [ v143, ClangCL ]
build-shared: [ "ON", "OFF" ]
exclude:
- platform: Win32
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
CMAKE_GENERATOR: ${{ matrix.generator }}
CMAKE_GENERATOR_TOOLSET: ${{ matrix.compiler }}
CMAKE_GENERATOR_PLATFORM: ${{ matrix.platform }}
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DGAPP_USE_LTO=ON
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DGAPP_USE_WERROR=ON -DGAPP_USE_LTO=ON

- name: build
run: cmake --build . --parallel --config ${{ matrix.build-type }}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(CMakePackageConfigHelpers)
option(GAPP_BUILD_TESTS "Build the tests for the library when ON." ON)
option(GAPP_BUILD_BENCHMARKS "Build the benchmarks for the library when ON." OFF)
option(GAPP_BUILD_EXAMPLES "Build the examples for the library when ON." OFF)
option(GAPP_USE_WERROR "Treat all warnings as errors during the build." ON)
option(GAPP_USE_WERROR "Treat all warnings as errors during the build." OFF)
option(GAPP_USE_LTO "Use link time optimizations for the library (only used for optimized builds)." OFF)
option(GAPP_USE_MARCH_NATIVE "Optimize for the host architecture in release builds (only used for gcc and clang)." OFF)
option(GAPP_DISABLE_EXCEPTIONS "Disable exception support when building the library." OFF)
Expand Down
20 changes: 10 additions & 10 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=/analyze:WX- -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=/analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset",
"enableMicrosoftCodeAnalysis": false,
Expand All @@ -18,7 +18,7 @@
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset",
"enableMicrosoftCodeAnalysis": false,
Expand All @@ -30,7 +30,7 @@
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset",
"enableMicrosoftCodeAnalysis": false,
Expand All @@ -42,7 +42,7 @@
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"enableClangTidyCodeAnalysis": false,
"inheritEnvironments": [ "clang_cl_x64_x64" ]
Expand All @@ -53,7 +53,7 @@
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"inheritEnvironments": [ "clang_cl_x64_x64" ]
},
Expand All @@ -63,7 +63,7 @@
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"inheritEnvironments": [ "clang_cl_x64_x64" ]
},
Expand All @@ -73,7 +73,7 @@
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DBUILD_SHARED_LIBS=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_USE_WERROR=ON -DBUILD_SHARED_LIBS=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset",
"enableMicrosoftCodeAnalysis": false,
Expand All @@ -85,7 +85,7 @@
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DBUILD_SHARED_LIBS=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DBUILD_SHARED_LIBS=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset",
"enableMicrosoftCodeAnalysis": false,
Expand All @@ -97,7 +97,7 @@
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_BUILD_TESTS=ON",
"cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"inheritEnvironments": [ "clang_cl_x64_x64" ],
"variables": [
Expand All @@ -113,7 +113,7 @@
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=/analyze:WX- -DGAPP_BUILD_TESTS=ON",
"cmakeCommandArgs": "-DGAPP_CXX_FLAGS=/analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON",
"ctestCommandArgs": "--output-on-failure --schedule-random",
"codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset",
"enableMicrosoftCodeAnalysis": true,
Expand Down
1 change: 1 addition & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def generate(self):
tc = CMakeToolchain(self)
tc.variables["GAPP_BUILD_TESTS"] = False
tc.variables["GAPP_USE_LTO"] = False
tc.variables["GAPP_USE_WERROR"] = False
tc.generate()

def build(self):
Expand Down

0 comments on commit f28ce14

Please sign in to comment.