From 922f2d67ae4d7fcd69fbd3f878e8a3b0b685fcac Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 29 Jan 2026 09:38:50 +0400 Subject: [PATCH] Add TARGET_OS to build dylib on macOS --- Makefile | 6 ++++-- nix/default.nix | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bb68e931..661e0013 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/nix/default.nix b/nix/default.nix index 55fb792d..5dfa42c8 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -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: