Skip to content

Commit

Permalink
Clean-Up: build.sh -std logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jan 18, 2022
1 parent f350c4f commit d842bd0
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
#!/usr/bin/env bash

# find out toolchain C++ standard
CXX_STANDARD=17
# avoid side-injection of -std=c++14 flag in some toolchains
if [[ ${CXXFLAGS} == *"-std=c++14"* ]]; then
echo "14 -> 17"
export CXXFLAGS="${CXXFLAGS} -std=c++17"
if [[ ! -z ${MACOSX_DEPLOYMENT_TARGET} ]]; then
export MACOSX_DEPLOYMENT_TARGET=10.13
fi
elif [[ ${CXXFLAGS} == *"-std=c++17"* ]]; then
echo "17"
CXX_STANDARD=17
elif [[ ${CXXFLAGS} == *"-std="* ]]; then
echo "ERROR: unknown C++ standard in toolchain!"
echo ${CXXFLAGS}
exit 1
fi

# IPO/LTO does only work with certain toolchains
Expand All @@ -29,7 +18,6 @@ do
-S ${SRC_DIR} -B build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_CXX_STANDARD=${CXX_STANDARD} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DWarpX_openpmd_internal=OFF \
Expand Down

0 comments on commit d842bd0

Please sign in to comment.