Skip to content

Commit

Permalink
better fix for Windows compilation
Browse files Browse the repository at this point in the history
- use gcc instead of g++
- use -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic instead of -static-stdc++

Belonging to [master]:
  - OpenModelica/OMCompiler#2570
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Jul 6, 2018
1 parent f251a60 commit c44a538
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenC.tpl
Expand Up @@ -5787,7 +5787,7 @@ case SIMCODE(modelInfo=MODELINFO(varInfo=varInfo as VARINFO(__)), delayedExps=DE
# Makefile generated by OpenModelica

# Simulations use -O3 by default
CC=<%if boolOr(boolOr(Flags.isSet(Flags.PARMODAUTO),acceptParModelicaGrammar()), boolOr(stringEq(makefileParams.platform, "win32"),stringEq(makefileParams.platform, "win64"))) then 'g++' else '<%makefileParams.ccompiler%>'%>
CC=<%if boolOr(Flags.isSet(Flags.PARMODAUTO),acceptParModelicaGrammar()) then 'g++' else '<%makefileParams.ccompiler%>'%>
CXX=<%makefileParams.cxxcompiler%>
LINK=<%makefileParams.linker%>
EXEEXT=<%makefileParams.exeext%>
Expand Down
2 changes: 1 addition & 1 deletion Compiler/runtime/omc_config.h
Expand Up @@ -98,7 +98,7 @@
/* adrpo: add -loleaut32 as is used by ExternalMedia */
#define BASIC_LDFLAGS_RT " -lomcgc -lexpat -lregex -static-libgcc -luuid -loleaut32 -lole32 -limagehlp -lws2_32 -llis -lumfpack -lklu -lcolamd -lbtf -lamd -lsundials_idas -lsundials_kinsol -lsundials_nvecserial -lipopt -lcoinmumps -Wl,-Bstatic -lpthread -Wl,-Bdynamic -lm -lgfortranbegin -lgfortran -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack"
#define LDFLAGS_RT " -lOpenModelicaRuntimeC" BASIC_LDFLAGS_RT
#define LDFLAGS_RT_SIM " -lSimulationRuntimeC" BASIC_LDFLAGS_RT " -lwsock32 -static-libstdc++"
#define LDFLAGS_RT_SIM " -lSimulationRuntimeC" BASIC_LDFLAGS_RT " -lwsock32 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic"
#define LDFLAGS_RT_SOURCE_FMU " -lregex -static-libgcc -Wl,-Bstatic -lpthread -Wl,-Bdynamic -lm -lgfortranbegin -lgfortran -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -limagehlp -lopenblas -lz -lhdf5"
#define CONFIG_EXE_EXT ".exe"
#define CONFIG_DLL_EXT ".dll"
Expand Down

0 comments on commit c44a538

Please sign in to comment.