Skip to content

Commit 3b3fa1d

Browse files
committed
- fix bootstrapping in Windows OMDEV (link sendData when building .dll to get all depends of omcruntime).
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7214 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 8bb6677 commit 3b3fa1d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Compiler/SimCodeC.mo

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10021,6 +10021,7 @@ algorithm
1002110021
local
1002210022
Tpl.Text txt;
1002310023
String i_name;
10024+
String i_makefileParams_senddatalibs;
1002410025
String i_makefileParams_ldflags;
1002510026
String i_makefileParams_cflags;
1002610027
String i_makefileParams_omhome;
@@ -10033,7 +10034,7 @@ algorithm
1003310034
Tpl.Text l_libsStr;
1003410035

1003510036
case ( txt,
10036-
SimCode.FUNCTIONCODE(makefileParams = SimCode.MAKEFILE_PARAMS(libs = i_makefileParams_libs, ccompiler = i_makefileParams_ccompiler, cxxcompiler = i_makefileParams_cxxcompiler, linker = i_makefileParams_linker, exeext = i_makefileParams_exeext, dllext = i_makefileParams_dllext, omhome = i_makefileParams_omhome, cflags = i_makefileParams_cflags, ldflags = i_makefileParams_ldflags), name = i_name) )
10037+
SimCode.FUNCTIONCODE(makefileParams = SimCode.MAKEFILE_PARAMS(libs = i_makefileParams_libs, ccompiler = i_makefileParams_ccompiler, cxxcompiler = i_makefileParams_cxxcompiler, linker = i_makefileParams_linker, exeext = i_makefileParams_exeext, dllext = i_makefileParams_dllext, omhome = i_makefileParams_omhome, cflags = i_makefileParams_cflags, ldflags = i_makefileParams_ldflags, senddatalibs = i_makefileParams_senddatalibs), name = i_name) )
1003710038
equation
1003810039
l_libsStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1003910040
l_libsStr = lm_248(l_libsStr, i_makefileParams_libs);
@@ -10067,6 +10068,9 @@ algorithm
1006710068
txt = Tpl.writeTok(txt, Tpl.ST_STRING("/lib/omc\" "));
1006810069
txt = Tpl.writeStr(txt, i_makefileParams_ldflags);
1006910070
txt = Tpl.softNewLine(txt);
10071+
txt = Tpl.writeTok(txt, Tpl.ST_STRING("SENDDATALIBS="));
10072+
txt = Tpl.writeStr(txt, i_makefileParams_senddatalibs);
10073+
txt = Tpl.softNewLine(txt);
1007010074
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1007110075
"\n",
1007210076
".PHONY: "
@@ -10088,7 +10092,7 @@ algorithm
1008810092
txt = Tpl.writeStr(txt, i_name);
1008910093
txt = Tpl.writeTok(txt, Tpl.ST_STRING(".c "));
1009010094
txt = Tpl.writeText(txt, l_libsStr);
10091-
txt = Tpl.writeTok(txt, Tpl.ST_STRING(" $(CFLAGS) $(LDFLAGS) -lm "));
10095+
txt = Tpl.writeTok(txt, Tpl.ST_STRING(" $(CFLAGS) $(LDFLAGS) $(SENDDATALIBS) -lm "));
1009210096
txt = Tpl.writeStr(txt, i_name);
1009310097
txt = Tpl.writeTok(txt, Tpl.ST_STRING("_records.c"));
1009410098
then txt;

Compiler/susan_codegen/SimCode/SimCodeC.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2537,10 +2537,11 @@ case FUNCTIONCODE(makefileParams=MAKEFILE_PARAMS(__)) then
25372537
DLLEXT=<%makefileParams.dllext%>
25382538
CFLAGS= -I"<%makefileParams.omhome%>/include/omc" <%makefileParams.cflags%>
25392539
LDFLAGS= -L"<%makefileParams.omhome%>/lib/omc" <%makefileParams.ldflags%>
2540+
SENDDATALIBS=<%makefileParams.senddatalibs%>
25402541

25412542
.PHONY: <%name%>
25422543
<%name%>: <%name%>.c <%name%>.h <%name%>_records.c
2543-
<%\t%> $(LINK) -o <%name%>$(DLLEXT) <%name%>.c <%libsStr%> $(CFLAGS) $(LDFLAGS) -lm <%name%>_records.c
2544+
<%\t%> $(LINK) -o <%name%>$(DLLEXT) <%name%>.c <%libsStr%> $(CFLAGS) $(LDFLAGS) $(SENDDATALIBS) -lm <%name%>_records.c
25442545
>>
25452546
end functionsMakefile;
25462547

0 commit comments

Comments
 (0)