Skip to content

Commit

Permalink
馃攢 Fix compiler portability issues
Browse files Browse the repository at this point in the history
The various github actions have introduced several points of failure
for this library, which have all been addressed.
  • Loading branch information
bitwizeshift committed Mar 7, 2021
2 parents 9577703 + 27f8c3b commit f2c21c2
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 99 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
push:
branches: [master]
paths:
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/analysis.yml'
pull_request:
branches: [master]
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/analysis.yml'
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ name: macOS
on:
push:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-macos.yml'
pull_request:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-macos.yml'

jobs:
test:
name: macoS Xcode ${{matrix.compiler.version}} ${{matrix.arch}} ${{matrix.build_type}}
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/build-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ name: Ubuntu
on:
push:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-ubuntu.yml'
pull_request:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-ubuntu.yml'

jobs:
test:
name: Ubuntu ${{matrix.compiler.cc}} ${{matrix.arch}} ${{matrix.build_type}}
Expand Down Expand Up @@ -100,6 +101,8 @@ jobs:
steps:
- name: Clone
uses: actions/checkout@v2
with:
submodules: true

- name: Prepare Environment
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ name: Windows
on:
push:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-windows.yml'
pull_request:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-windows.yml'
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Build
working-directory: ${{env.build-directory}}
run: cmake --build . --config ${{matrix.build_type}}
run: cmake --build . --target Delegate.test --config ${{matrix.build_type}}

- name: Test
working-directory: ${{env.build-directory}}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ name: "Code Coverage"
on:
push:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/coverage.yml'
pull_request:
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/coverage.yml'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/scan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
push:
branches: [master]
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/scan-build.yml'
pull_request:
branches: [master]
paths:
- '.gitmodules'
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '.gitmodules'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/scan-build.yml'
Expand Down
30 changes: 1 addition & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND

# Disable unnecessary compatibility and 'newline-eof'. This is a modern C++
# library -- so these serve no purpose
add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-newline-eof)

# Disable warnings on padding. This is a great warning, but not good when
# coupled with -Werror
add_compile_options(-Wno-padded)

# Several utilities require static objects that have exit-time destructors,
# including 'error_category' types from the standard.
add_compile_options(-Wno-exit-time-destructors)

# This is erroring on valid uses of the standard library, like std::lock_guard.
add_compile_options(-Wno-ctad-maybe-unsupported)

# This is a good warning *in general*, but not when using MSVC's standard
# library, which requires defining "_" prefixed macros just to have it operate
# like the C++ standard dictates.
add_compile_options(-Wno-reserved-id-macro)

# Don't warn on ignored attributes; this breaks builds using dllexport/dllimport on
# classes that may also define inline functions
add_compile_options(-Wno-ignored-attributes)
add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic)

elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-Wall -Werror -Wextra -pedantic -pedantic-errors)

# Xcode 11.2 seems to enable -Wnewline-eof with '-Wextra'. Disable this,
# since it's a legacy requirement not needed in C++11 onward.
add_compile_options(-Wno-newline-eof)

# Don't warn on ignored attributes; this breaks builds using dllexport/dllimport on
# classes that may also define inline functions
add_compile_options(-Wno-ignored-attributes)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options(/W4 /WX)
endif ()
Expand Down
Loading

0 comments on commit f2c21c2

Please sign in to comment.