Skip to content

Commit d893321

Browse files
committed
re-add vendoring
1 parent 8894842 commit d893321

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

cpp4rtest/src/Makevars.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
CXX_STD = CXXNN
2+
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=4
3+
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
4+
5+
# Debugging
6+
7+
# uncomment one of the following lines to enable debugging
8+
# PKG_CPPFLAGS = -UDEBUG -g
9+
PKG_CPPFLAGS = -UDEBUG -g -I vendor/
10+
11+
# uncomment to disable compiler optimizations
12+
PKG_CXXFLAGS = -Wall -O0 -pedantic

scripts/check_restore.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,22 @@ elif [ "$std" = "CXX20" ]; then cpp_std="C++20"
1515
elif [ "$std" = "CXX23" ]; then cpp_std="C++23"
1616
else cpp_std="$std"; fi
1717

18-
# Restore Makevars.in placeholder
19-
echo "CXX_STD = CXXNN" > ./cpp4rtest/src/Makevars.in
18+
mfile="./cpp4rtest/src/Makevars.in"
19+
if [ -f "$mfile" ]; then
20+
# replace existing CXX_STD line (handles optional quotes)
21+
if grep -q '^CXX_STD[[:space:]]*=' "$mfile"; then
22+
sed -E -i 's|^CXX_STD[[:space:]]*=.*|CXX_STD = CXXNN|' "$mfile"
23+
else
24+
# Prepend CXX_STD line to the existing Makevars.in
25+
tmpfile="${mfile}.tmp"
26+
printf "CXX_STD = CXXNN\n" > "$tmpfile"
27+
cat "$mfile" >> "$tmpfile"
28+
mv "$tmpfile" "$mfile"
29+
fi
30+
else
31+
# File doesn't exist: create with CXX_STD line
32+
echo "CXX_STD = CXXNN" > "$mfile"
33+
fi
2034

2135
# Restore GCC by unsetting USE_CLANG
2236
unset USE_CLANG || true

0 commit comments

Comments
 (0)