Skip to content

Commit

Permalink
chore: add scripted
Browse files Browse the repository at this point in the history
  • Loading branch information
darshankabariya committed Oct 13, 2024
1 parent fe1e6cd commit a0cf87a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ FORMAT_MSG := "\\x1B[95mFormatting:\\x1B[39m"
OS := Windows_NT

ifeq ($(OS),Windows_NT)
LIBS = -static -lws2_32 -lbcrypt -luserenv - lntdll
NIM_PARAMS += $(foreach lib, $(LIBS), --paasL:"S(lib)")

BUILD_ALL_DIR := vendor/nimbus-build-system/vendor/Nim
ifneq ($(wildcard $(BUILD_ALL_BAT)),)
# Debug: Print the directory before executing
@echo "----------------- Executing build_all.bat in directory -------------------"
# Change to the BUILD_ALL_DIR, run build_all.bat, and return to original directory
$(shell cd $(BUILD_ALL_BAT) && build_all.bat && cd ../../../..)
endif
# Add the necessary libraries to the linker flags
LIBS = -static -lws2_32 -lbcrypt -luserenv -lntdll
NIM_PARAMS += $(foreach lib,$(LIBS),--passL:"$(lib)")
$(info $(shell ./scripts/windows_setup.sh))
endif

endif

Expand Down
23 changes: 23 additions & 0 deletions scripts/windows_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
echo "Executing build_all.bat for Windows"
BUILD_DIR="vendor/nimbus-build-system/vendor/Nim"

if [ ! -d "$BUILD_DIR" ]; then
echo "Directory not found: $BUILD_DIR"
else
cd "$BUILD_DIR" || exit
./build_all.bat
cd ../../../..
fi

LIBUNWIND_DIR="vendor/libbacktrace"

if [ ! -d "$LIBUNWIND_DIR" ]; then
echo "Directory not found: $LIBUNWIND_DIR"
else
cd "$LIBUNWIND_DIR" || exit
make install/usr/local/libunwind.a
cd ../..
fi

echo "Building nimbus-build-system for Windows"

0 comments on commit a0cf87a

Please sign in to comment.