-
Notifications
You must be signed in to change notification settings - Fork 297
/
CMakeCrossCompile.mos
29 lines (24 loc) · 1.13 KB
/
CMakeCrossCompile.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// status: correct
// Note: Requires docker in PATH
//
// Test cross compilation with CMake FMU build using multiarch/crossbuild image.
if not loadModel(Modelica, {"4.0.0"}) then
print(getErrorString());
exit(1);
end if;
system("rm -rf CMakeCrossCompile && mkdir CMakeCrossCompile", "CMakeCrossCompile.log");
cd("CMakeCrossCompile");
// Set CMake FMU without any filters
// Disable CMake features, because version in multiarch/crossbuild is too old.
if not setCommandLineOptions("--fmiFilter=none --fmuCMakeBuild=true --fmuRuntimeDepends=none") then
print(getErrorString());
exit(1);
end if;
// Build FMU
platforms := {
"x86_64-apple-darwin docker run multiarch/crossbuild",
"x86_64-linux-gnu docker run multiarch/crossbuild",
"i686-linux-gnu docker run docker.openmodelica.org/build-deps:v1.13-i386",
"x86_64-w64-mingw32 docker run multiarch/crossbuild",
"i686-w64-mingw32 docker run multiarch/crossbuild"};
buildModelFMU(Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, version="2.0", fmuType="me_cs", fileNamePrefix="Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum", platforms=platforms); getErrorString();