Skip to content

Commit 9c5e576

Browse files
committed
build.sh:simple build script
1 parent a7de848 commit 9c5e576

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
compiler=${1:-clang++}
2+
# Go up one directory from 'build' to 'bitcoin'
3+
pushd . || exit
4+
5+
# Remove the old build directory to ensure a clean slate
6+
# rm -rf build || true
7+
8+
# Create a new build directory
9+
mkdir -p build
10+
11+
# Change into the new build directory
12+
pushd ./build || exit
13+
14+
if command -v brew &> /dev/null
15+
then
16+
CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++
17+
fi
18+
19+
# Run CMake, explicitly setting the C++ standard to 20
20+
# We'll also explicitly set the C++ compiler to clang++ (common on macOS)
21+
# If you prefer g++, replace 'clang++' with 'g++'
22+
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_COMPILER=$compiler -S ../
23+
24+
# Now, try to build again
25+
make

0 commit comments

Comments
 (0)