From 7a7247f57f2608699fff29953a4d8f5d5fb080a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Franke?= Date: Sun, 5 Jun 2016 19:54:48 +0200 Subject: [PATCH] Link Cpp FMUs all static under Windows This in particular links the static pthread lib, in addition to static libstdc++ and libgcc. --- Compiler/Template/CodegenFMUCpp.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Compiler/Template/CodegenFMUCpp.tpl b/Compiler/Template/CodegenFMUCpp.tpl index 743ed92d471..98b1a40d98c 100644 --- a/Compiler/Template/CodegenFMUCpp.tpl +++ b/Compiler/Template/CodegenFMUCpp.tpl @@ -787,13 +787,13 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula $(eval BINARIES=$(BINARIES) <%lapackbins%>) endif - # need boost system lib prior to C++11 + # need boost system lib prior to C++11, forcing also dynamic libs ifeq ($(findstring USE_CPP_03,$(CFLAGS)),USE_CPP_03) $(eval LIBS=$(LIBS) -L"$(BOOST_LIBS)" -l$(BOOST_SYSTEM_LIB)) $(eval BINARIES=$(BINARIES) $(BOOST_LIBS)/lib$(BOOST_SYSTEM_LIB)$(DLLEXT) <%platformbins%>) - # link static gcc libs to avoid dependencies + # link static libs to avoid dependencies; can't link all static under Linux else ifeq ($(findstring gcc,$(CC)),gcc) - $(eval LIBS=$(LIBS) -static-libstdc++ -static-libgcc) + $(eval LIBS=$(LIBS) $(if $(findstring linux,$(PLATFORM)),-static-libstdc++ -static-libgcc,-static)) endif CPPFILES=$(CALCHELPERMAINFILE)