Fix build compatibility for macOS 10.14 and below (#1280)

macOS 10.15 introduced full `std::filesystem::path` support.
Before that our use of it would cause the build to fail.
This was not caught because "-mmacosx-version-min=10.9" was only
being passed to clang++ for release builds.

This passes that flag in a new static CI test build, and introduces
a hack developed by @LIJI32 to silence the availability errors,
since we use features already available in macOS 10.9.

This means we are testing both "vanilla" building,
and building static binaries using the same configuration
as during release, which should help avoiding last-minute
surprises.
This commit is contained in:
Rangi
2023-12-29 16:47:11 -05:00
committed by GitHub
parent dc5d3a7342
commit 1f3985a164
5 changed files with 102 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ WARNFLAGS := -Wall -Wno-unknown-warning-option -Wno-c99-designator
# Overridable CXXFLAGS
CXXFLAGS ?= -O3 -flto -DNDEBUG
# Non-overridable CXXFLAGS
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -x c++ -std=c++2a -I include \
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++2a -I include \
-D_POSIX_C_SOURCE=200809L -fno-exceptions -fno-rtti
# Overridable LDFLAGS
LDFLAGS ?=
@@ -200,7 +200,7 @@ checkdiff:
# The rationale for some of the flags is documented in the CMakeLists.
develop:
$Qenv ${MAKE} WARNFLAGS="${WARNFLAGS} -Werror -Wextra \
$Q${MAKE} WARNFLAGS="${WARNFLAGS} -Werror -Wextra \
-Walloc-zero -Wcast-align -Wcast-qual -Wduplicated-branches -Wduplicated-cond \
-Wfloat-equal -Wlogical-op -Wnull-dereference -Wshift-overflow=2 \
-Wstringop-overflow=4 -Wstrict-overflow=5 -Wundef -Wuninitialized -Wunused \