-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
30 lines (25 loc) · 893 Bytes
/
build.sh
File metadata and controls
30 lines (25 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Build opennest_solver.dll (C++ CMake, Visual Studio 2022, x64)
# Usage: ./build.sh [--reconfigure]
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="$SCRIPT_DIR/build"
echo "=== nest: C++ DLL build ==="
echo "Output: $BUILD_DIR/Release/opennest_solver.dll"
echo ""
# Re-run CMake configure if requested or cache is missing
if [[ "${1:-}" == "--reconfigure" ]] || [ ! -f "$BUILD_DIR/CMakeCache.txt" ]; then
echo "--- cmake configure ---"
cmake -B "$BUILD_DIR" -G "Visual Studio 17 2022" -A x64 -S "$SCRIPT_DIR"
echo ""
fi
echo "--- cmake build (Release, target: opennest_solver) ---"
cmake --build "$BUILD_DIR" --config Release --target opennest_solver
echo ""
DLL="$BUILD_DIR/Release/opennest_solver.dll"
if [ -f "$DLL" ]; then
echo "OK $DLL"
else
echo "FAIL: DLL not found at expected path."
exit 1
fi