Skip to content

Commit 2eaefff

Browse files
committed
cmake-build-macos.sh:for testing
1 parent bb08cba commit 2eaefff

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

cmake-build-macos.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
brew install llvm
17+
export LDFLAGS="-L/usr/local/opt/llvm/lib"
18+
export CPPFLAGS="-I/usr/local/opt/llvm/include"
19+
CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++
20+
fi
21+
22+
# Run CMake, explicitly setting the C++ standard to 20
23+
# We'll also explicitly set the C++ compiler to clang++ (common on macOS)
24+
# If you prefer g++, replace 'clang++' with 'g++'
25+
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_COMPILER=$compiler -DBUILD_GUI=ON -LH -S ../
26+
27+
# Now, try to build again
28+
make

0 commit comments

Comments
 (0)