Browse Source

package: enable _LIBCPP_REMOVE_TRANSITIVE_INCLUDES for all libc++ builds.

Which makes libc++ since version 16 not use transitive includes for
backwards compatibility, both for faster build times and to detect if
some code is missing a transitive include (which could blow up for the
user even w/o this macro defined, as compiling with -std=c++23 also
removes quite a lot such includes).

This affects Android, macOS/iOS and Emscripten. On the CI right now all
VMs use older libc++, which means it does nothing, but it's done there
anyway to future-proof. Locally on Arch it affects the Android and
Emscripten builds already, as well as an explicit clang + libc++ build.
pull/690/head
Vladimír Vondruš 3 months ago
parent
commit
2e8571d8fd
  1. 4
      package/archlinux/PKGBUILD-android-arm64
  2. 5
      package/archlinux/PKGBUILD-clang-libc++
  3. 4
      package/archlinux/PKGBUILD-emscripten-wasm
  4. 4
      package/archlinux/PKGBUILD-emscripten-wasm-webgl2
  5. 7
      package/ci/android-x86-gles.sh
  6. 7
      package/ci/android-x86-vulkan.sh
  7. 24
      package/ci/circleci.yml
  8. 7
      package/ci/emscripten.sh
  9. 7
      package/ci/ios-simulator-gles.sh

4
package/archlinux/PKGBUILD-android-arm64

@ -35,6 +35,10 @@ build() {
# CLICOLOR_FORCE=1: https://github.com/ninja-build/ninja/issues/2196 # CLICOLOR_FORCE=1: https://github.com/ninja-build/ninja/issues/2196
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
`# Make libc++ remove transitive includes, both for faster build` \
`# times and to detect if we're missing a transitive include. Works` \
`# with libc++ 16+, which is used by NDK r26+.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DCMAKE_COLOR_DIAGNOSTICS=ON \ -DCMAKE_COLOR_DIAGNOSTICS=ON \
-DMAGNUM_WITH_VK=ON \ -DMAGNUM_WITH_VK=ON \
-DMAGNUM_WITH_ANYAUDIOIMPORTER=OFF \ -DMAGNUM_WITH_ANYAUDIOIMPORTER=OFF \

5
package/archlinux/PKGBUILD-clang-libc++

@ -25,7 +25,10 @@ build() {
-DCMAKE_CROSS_CONFIGS=all \ -DCMAKE_CROSS_CONFIGS=all \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -fno-omit-frame-pointer" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -fno-omit-frame-pointer" \
-DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \ `# Make libc++ remove transitive includes, both for faster build` \
`# times and to detect if we're missing a transitive include.` \
`# Works with libc++ 16+, which is used by NDK r26+.` \
-DCMAKE_CXX_FLAGS="-stdlib=libc++ -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DCMAKE_EXE_LINKER_FLAGS=-lc++abi \ -DCMAKE_EXE_LINKER_FLAGS=-lc++abi \
-G "Ninja Multi-Config" -G "Ninja Multi-Config"
fi fi

4
package/archlinux/PKGBUILD-emscripten-wasm

@ -51,6 +51,10 @@ build() {
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/lib/emscripten/system \ -DCMAKE_INSTALL_PREFIX=/usr/lib/emscripten/system \
`# Make libc++ remove transitive includes, both for faster build` \
`# times and to detect if we're missing a transitive include. Works` \
`# with libc++ 16+.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DCMAKE_COLOR_DIAGNOSTICS=ON \ -DCMAKE_COLOR_DIAGNOSTICS=ON \
-DMAGNUM_DEPLOY_PREFIX=/srv/http/emscripten \ -DMAGNUM_DEPLOY_PREFIX=/srv/http/emscripten \
-DMAGNUM_WITH_AUDIO=ON \ -DMAGNUM_WITH_AUDIO=ON \

4
package/archlinux/PKGBUILD-emscripten-wasm-webgl2

@ -51,6 +51,10 @@ build() {
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/lib/emscripten/system \ -DCMAKE_INSTALL_PREFIX=/usr/lib/emscripten/system \
`# Make libc++ remove transitive includes, both for faster build` \
`# times and to detect if we're missing a transitive include. Works` \
`# with libc++ 16+.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DCMAKE_COLOR_DIAGNOSTICS=ON \ -DCMAKE_COLOR_DIAGNOSTICS=ON \
-DMAGNUM_DEPLOY_PREFIX=/srv/http/emscripten-webgl2 \ -DMAGNUM_DEPLOY_PREFIX=/srv/http/emscripten-webgl2 \
-DMAGNUM_TARGET_GLES2=OFF \ -DMAGNUM_TARGET_GLES2=OFF \

7
package/ci/android-x86-gles.sh

@ -54,6 +54,13 @@ cmake .. \
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ -DCMAKE_INSTALL_PREFIX=$HOME/deps \
-DCMAKE_PREFIX_PATH=$HOME/deps \ -DCMAKE_PREFIX_PATH=$HOME/deps \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
`# Make libc++ remove transitive includes, both for faster build times` \
`# and to detect if we're missing a transitive include. Works with` \
`# libc++ 16+, which is used by NDK r26+ (i.e., will get used next time` \
`# the android image is bumped). Not doing this for the Corrade build,` \
`# as that'd only add extra friction with no possibility of fixing from` \
`# here.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ -DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \
-DMAGNUM_TARGET_GLES2=$TARGET_GLES2 \ -DMAGNUM_TARGET_GLES2=$TARGET_GLES2 \
-DMAGNUM_WITH_AUDIO=OFF \ -DMAGNUM_WITH_AUDIO=OFF \

7
package/ci/android-x86-vulkan.sh

@ -55,6 +55,13 @@ cmake .. \
-DCMAKE_ANDROID_STL_TYPE=c++_static \ -DCMAKE_ANDROID_STL_TYPE=c++_static \
-DCMAKE_FIND_ROOT_PATH="/opt/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot;$HOME/deps" \ -DCMAKE_FIND_ROOT_PATH="/opt/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot;$HOME/deps" \
-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=/i686-linux-android/29 \ -DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=/i686-linux-android/29 \
`# Make libc++ remove transitive includes, both for faster build times` \
`# and to detect if we're missing a transitive include. Works with` \
`# libc++ 16+, which is used by NDK r26+ (i.e., will get used next time` \
`# the android image is bumped). Not doing this for the Corrade build,` \
`# as that'd only add extra friction with no possibility of fixing from` \
`# here.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ -DCMAKE_INSTALL_PREFIX=$HOME/deps \
-DCMAKE_PREFIX_PATH=$HOME/deps \ -DCMAKE_PREFIX_PATH=$HOME/deps \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \

24
package/ci/circleci.yml

@ -671,7 +671,11 @@ jobs:
macos-gl: macos-gl:
executor: xcode-14_3 executor: xcode-14_3
environment: environment:
CMAKE_CXX_FLAGS: --coverage # Make libc++ remove transitive includes, both for faster build times and
# to detect if we're missing a transitive include. Works with libc++ 16+,
# which is used by Xcode 15 (i.e., will get used on the next CircleCI
# executor update).
CMAKE_CXX_FLAGS: --coverage -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
CONFIGURATION: Debug CONFIGURATION: Debug
EXTRA_OPTS: > EXTRA_OPTS: >
-DMAGNUM_WITH_WINDOWLESSCGLAPPLICATION=ON -DMAGNUM_WITH_WINDOWLESSCGLAPPLICATION=ON
@ -690,7 +694,11 @@ jobs:
macos-gles3: macos-gles3:
executor: xcode-14_3 executor: xcode-14_3
environment: environment:
CMAKE_CXX_FLAGS: --coverage # Make libc++ remove transitive includes, both for faster build times and
# to detect if we're missing a transitive include. Works with libc++ 16+,
# which is used by Xcode 15 (i.e., will get used on the next CircleCI
# executor update).
CMAKE_CXX_FLAGS: --coverage -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
CONFIGURATION: Debug CONFIGURATION: Debug
EXTRA_OPTS: > EXTRA_OPTS: >
-DMAGNUM_WITH_WINDOWLESSEGLAPPLICATION=ON -DMAGNUM_WITH_WINDOWLESSEGLAPPLICATION=ON
@ -712,7 +720,11 @@ jobs:
macos-vulkan: macos-vulkan:
executor: xcode-14_3 executor: xcode-14_3
environment: environment:
CMAKE_CXX_FLAGS: --coverage # Make libc++ remove transitive includes, both for faster build times and
# to detect if we're missing a transitive include. Works with libc++ 16+,
# which is used by Xcode 15 (i.e., will get used on the next CircleCI
# executor update).
CMAKE_CXX_FLAGS: --coverage -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
steps: steps:
- install-base-macos: - install-base-macos:
extra: sdl2 glfw wget extra: sdl2 glfw wget
@ -746,7 +758,11 @@ jobs:
# For some reason on the 15.1 image OpenAL hangs on startup. Skip those # For some reason on the 15.1 image OpenAL hangs on startup. Skip those
# tests. # tests.
EXTRA_EXCLUDED_TESTS: "|ALTest" EXTRA_EXCLUDED_TESTS: "|ALTest"
CMAKE_CXX_FLAGS: --coverage # Make libc++ remove transitive includes, both for faster build times and
# to detect if we're missing a transitive include. Works with libc++ 16+,
# which is used by Xcode 15 (i.e., will get used on the next CircleCI
# executor update).
CMAKE_CXX_FLAGS: --coverage -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
CONFIGURATION: Debug CONFIGURATION: Debug
steps: steps:
# macos-gl tests with dynamic MoltenVK # macos-gl tests with dynamic MoltenVK

7
package/ci/emscripten.sh

@ -32,6 +32,13 @@ cmake .. \
-DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ -DCMAKE_INSTALL_PREFIX=$HOME/deps \
-DCMAKE_FIND_ROOT_PATH=$HOME/deps \ -DCMAKE_FIND_ROOT_PATH=$HOME/deps \
`# Make libc++ remove transitive includes, both for faster build times` \
`# and to detect if we're missing a transitive include. Works with` \
`# libc++ 16+, which is used by Emscripten 3.1.18+ (i.e., will get used` \
`# next time emsdk is bumped). Not doing this for the Corrade build, as` \
`# that'd only add extra friction with no possibility of fixing from` \
`# here.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DMAGNUM_WITH_AUDIO=ON \ -DMAGNUM_WITH_AUDIO=ON \
-DMAGNUM_WITH_VK=OFF \ -DMAGNUM_WITH_VK=OFF \
-DMAGNUM_WITH_EMSCRIPTENAPPLICATION=ON \ -DMAGNUM_WITH_EMSCRIPTENAPPLICATION=ON \

7
package/ci/ios-simulator-gles.sh

@ -56,6 +56,13 @@ cmake .. \
-DCMAKE_PREFIX_PATH="$HOME/deps" \ -DCMAKE_PREFIX_PATH="$HOME/deps" \
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ -DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ -DCMAKE_INSTALL_PREFIX=$HOME/deps \
`# Make libc++ remove transitive includes, both for faster build times` \
`# and to detect if we're missing a transitive include. Works with` \
`# libc++ 16+, which is used by Xcode 15 (i.e., will get used on the` \
`# next CircleCI executor update). Not doing this for the Corrade build` \
`# as that'd only add extra friction with no possibility of fixing from` \
`# here.` \
-DCMAKE_CXX_FLAGS="-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES" \
-DMAGNUM_TARGET_GLES2=$TARGET_GLES2 \ -DMAGNUM_TARGET_GLES2=$TARGET_GLES2 \
-DMAGNUM_WITH_AUDIO=ON \ -DMAGNUM_WITH_AUDIO=ON \
-DMAGNUM_WITH_VK=OFF \ -DMAGNUM_WITH_VK=OFF \

Loading…
Cancel
Save