diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 879e6435..d29e522e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,14 +40,6 @@ jobs: - os: "windows-2022" compiler: "msvc" vcvarsall: false - - os: "macos-11" - compiler: "gcc" - cmake: true - vcvarsall: true - - os: "macos-13" - compiler: "gcc" - cmake: true - vcvarsall: true exclude: # fails with an internal error - os: "macos-12" diff --git a/src/Hardening.cmake b/src/Hardening.cmake index eb8c985d..dc7bb670 100644 --- a/src/Hardening.cmake +++ b/src/Hardening.cmake @@ -44,7 +44,7 @@ function( list(APPEND HARDENING_COMPILE_OPTIONS -Wstringop-overflow=4 -Wformat-overflow=2) endif() - target_compile_definitions(${_project_name} INTERFACE $<$:_FORTIFY_SOURCE=3>) + target_compile_options(${_project_name} INTERFACE $<$:-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3>) endif() if(${ENABLE_ELF_PROTECTION}) diff --git a/tests/myproj/CMakeLists.txt b/tests/myproj/CMakeLists.txt index d578b17f..1bfa2849 100644 --- a/tests/myproj/CMakeLists.txt +++ b/tests/myproj/CMakeLists.txt @@ -88,6 +88,10 @@ project_options( # CLANG_WARNINGS "-Weverything" LINKER "${LINKER}" + + # Test if _FORTIFY_SOURCE is defined only once when ENABLE_OVERFLOW_PROTECTION + ENABLE_OVERFLOW_PROTECTION + CLANG_TIDY_EXTRA_ARGUMENTS "-warnings-as-errors=clang-diagnostic-macro-redefined" ) # NOTE: project_options and project_warnings are defined inside project_options