Skip to content

Commit

Permalink
fix(mkfile): attempt #4 to fix dynamic lib creation linking issues wi…
Browse files Browse the repository at this point in the history
…th windows clang ld-link
  • Loading branch information
lexouduck committed Nov 22, 2024
1 parent f87149d commit 075aaad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libccc@0.12.4-2024-11-22_5cfb6a78cf0f6f057bace9abc551df397752d10b
libccc@0.12.5-2024-11-22_f87149d88a62fca275260c42a58c6fe2d031871c
2 changes: 1 addition & 1 deletion mkfile/config/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ CFLAGS_BUILDMODE_release = \

#! C compiler options which are platform-specific, according to $(OSMODE)
CFLAGS_OS = $(CFLAGS_OS_$(OSMODE))
CFLAGS_OS_windows = -D__USE_MINGW_ANSI_STDIO=1 # -fno-ms-compatibility
CFLAGS_OS_windows = -D__USE_MINGW_ANSI_STDIO=1 -fvisibility=default # -fno-ms-compatibility
CFLAGS_OS_macos = -Wno-language-extension-token
CFLAGS_OS_linux = -Wno-unused-result -fPIC
CFLAGS_OS_other =
Expand Down
7 changes: 6 additions & 1 deletion mkfile/rules/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $(OBJSFILE): $(SRCSFILE)
$(OBJPATH)%.o : $(SRCDIR)%.c
@mkdir -p $(@D)
@printf "Compiling file: $@ -> "
@$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -fvisibility=default -MMD $(INCLUDES) -c $<
@$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -MMD $(INCLUDES) -c $<
@printf $(IO_GREEN)"OK!"$(IO_RESET)"\n"


Expand Down Expand Up @@ -122,11 +122,16 @@ ifeq ($(OSMODE),macos)
-install_name '@loader_path/$(NAME_dynamic)'
endif
ifeq ($(OSMODE),windows)
ifeq ($(CC),clang)
@$(CC) -shared -o $@ $(CFLAGS) $(LDFLAGS) $(call objs) $(LDLIBS) \
-fvisibility=default
else
@$(CC) -shared -o $@ $(CFLAGS) $(LDFLAGS) $(call objs) $(LDLIBS) \
-Wl,--output-def,$(BINPATH)dynamic/$(NAME).def \
-Wl,--out-implib,$(BINPATH)dynamic/$(NAME).lib \
-Wl,--export-all-symbols
endif
endif
ifeq ($(OSMODE),emscripten)
@$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(call objs) $(LDLIBS) \
-s EXPORTED_FUNCTIONS=[_JSON_FromString_Lenient,_JSON_ToString_Minify,_KVT_Delete] \
Expand Down

0 comments on commit 075aaad

Please sign in to comment.