diff --git a/.github/scripts/run-windows.ps1 b/.github/scripts/run-windows.ps1 new file mode 100644 index 0000000..1b0e4e0 --- /dev/null +++ b/.github/scripts/run-windows.ps1 @@ -0,0 +1,6 @@ +param( + [string]$BinaryName = "example.exe" +) + +$env:PATH = "$PWD\libs;" + $env:PATH +& ".\$BinaryName" \ No newline at end of file diff --git a/Makefile b/Makefile index 4df4b6a..db62605 100644 --- a/Makefile +++ b/Makefile @@ -41,8 +41,7 @@ build: run: ifeq ($(OS),Windows_NT) - pwsh -Command "Copy-Item libs\libcodex.dll ." - pwsh -Command ".\$(BIN_NAME)" + pwsh -File ../scripts/run-windows.ps1 -BinaryName $(BIN_NAME) else ifeq ($(UNAME_S),Darwin) # Instead of relying on install_name_tool, we can define DYLD_LIBRARY_PATH # DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME)