Add TARGET_OS to build dylib on macOS

This commit is contained in:
Arnaud 2026-01-29 09:38:50 +04:00
parent 52d27485cd
commit 922f2d67ae
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F
2 changed files with 5 additions and 2 deletions

View File

@ -234,6 +234,8 @@ ifneq ($(strip $(STORAGE_LIB_PARAMS)),)
NIM_PARAMS := $(NIM_PARAMS) $(STORAGE_LIB_PARAMS)
endif
TARGET_OS ?= $(detected_OS)
libstorage:
$(MAKE) deps
rm -f build/libstorage*
@ -241,10 +243,10 @@ libstorage:
ifeq ($(STATIC), 1)
echo -e $(BUILD_MSG) "build/$@.a" && \
$(ENV_SCRIPT) nim libstorageStatic $(NIM_PARAMS) codex.nims
else ifeq ($(detected_OS),Windows)
else ifeq ($(TARGET_OS),Windows)
echo -e $(BUILD_MSG) "build/$@.dll" && \
$(ENV_SCRIPT) nim libstorageDynamic $(NIM_PARAMS) codex.nims
else ifeq ($(detected_OS),macOS)
else ifeq ($(TARGET_OS),macOS)
echo -e $(BUILD_MSG) "build/$@.dylib" && \
$(ENV_SCRIPT) nim libstorageDynamic $(NIM_PARAMS) codex.nims
else

View File

@ -70,6 +70,7 @@ in stdenv.mkDerivation rec {
"V=${toString verbosity}"
"QUICK_AND_DIRTY_COMPILER=${if quickAndDirty then "1" else "0"}"
"QUICK_AND_DIRTY_NIMBLE=${if quickAndDirty then "1" else "0"}"
"TARGET_OS=${if stdenv.hostPlatform.isDarwin then "macOS" else "Linux"}"
];
# FIXME: Remove once permanent fix is applied to NBS: