diff --git a/config.mk b/config.mk index 69a815c..6ba0250 100644 --- a/config.mk +++ b/config.mk @@ -44,3 +44,9 @@ ifneq ($(STRIP),) XLDFLAGS += -Wl,--strip-all DLL_LDFLAGS += -Wl,--strip-all endif + +ifneq ($(firstword $(filter MINGW32_NT-% MINGW64_NT-% CYGWIN_NT-%,$(shell uname))),) + ENV_LDPATH := PATH +else + ENV_LDPATH := LD_LIBRARY_PATH +endif diff --git a/test/hash-map/Makefile b/test/hash-map/Makefile index 7d35e51..872e8d1 100644 --- a/test/hash-map/Makefile +++ b/test/hash-map/Makefile @@ -21,7 +21,7 @@ $(ALL_PATH): mkdir -p $@ test: all - ./$(BIN_FILE) + env $(ENV_LDPATH)="$(realpath .):$(realpath ../../libhashset/lib)$(if $($(ENV_LDPATH)),:$($(ENV_LDPATH)))" ./$(BIN_FILE) clean: rm -vf $(BIN_FILE) diff --git a/test/hash-set/Makefile b/test/hash-set/Makefile index 33ddf34..5f85946 100644 --- a/test/hash-set/Makefile +++ b/test/hash-set/Makefile @@ -21,7 +21,7 @@ $(ALL_PATH): mkdir -p $@ test: all - ./$(BIN_FILE) + env $(ENV_LDPATH)="$(realpath .):$(realpath ../../libhashset/lib)$(if $($(ENV_LDPATH)),:$($(ENV_LDPATH)))" ./$(BIN_FILE) clean: rm -vf $(BIN_FILE)