@@ -86,16 +86,37 @@ function setupPlatform() {
86
86
platformBasicConfigureArgs+=(--host=aarch64-apple-darwin)
87
87
platformBasicConfigureArgsPixmanCairo+=(--host=arm-apple-darwin) # For pixman and cairo we must use arm-apple thank to https://gist.github.com/jvcleave/9d78de9bb27434bde2b0c3a1af355d9c
88
88
platformExtraCMakeArgs+=(-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT /cmake/$targetPlatform .cmake);;
89
+
89
90
" iOS_Simulator" )
90
- target =x86_64
91
+ targetArch =x86_64
91
92
boostArch=ia64
92
93
targetSysroot=` xcodebuild -version -sdk iphonesimulator Path`
93
94
platformExtraCMakeArgs+=(-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT /cmake/$targetPlatform .cmake);;
95
+
96
+ " iOS_Simulator_M1" )
97
+ targetArch=arm64
98
+ boostArch=arm
99
+ targetSysroot=` xcodebuild -version -sdk iphonesimulator Path`
100
+ platformExtraCMakeArgs+=(-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT /cmake/$targetPlatform .cmake);;
101
+
102
+ " macCatalyst" )
103
+ targetArch=x86_64
104
+ boostArch=ia64
105
+ targetSysroot=` xcodebuild -version -sdk macosx Path`
106
+ platformExtraCMakeArgs+=(-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT /cmake/$targetPlatform .cmake);;
107
+
108
+ " macCatalyst_M1" )
109
+ targetArch=arm64
110
+ boostArch=arm
111
+ targetSysroot=` xcodebuild -version -sdk macosx Path`
112
+ platformExtraCMakeArgs+=(-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT /cmake/$targetPlatform .cmake);;
113
+
94
114
" macOS" )
95
115
targetArch=x86_64
96
116
boostArch=ia64
97
117
targetSysroot=` xcodebuild -version -sdk macosx Path`
98
118
platformExtraCMakeArgs+=(-DCMAKE_OSX_ARCHITECTURES=$targetArch );;
119
+
99
120
" macOS_M1" )
100
121
targetArch=arm64
101
122
boostArch=arm
@@ -107,7 +128,16 @@ function setupPlatform() {
107
128
}
108
129
109
130
function setCompilerFlags() {
110
- export CFLAGS=" -isysroot $targetSysroot -arch $targetArch -I$ros2SystemDependenciesPath /include/"
131
+ case $targetPlatform in
132
+ " macCatalyst" )
133
+ export CFLAGS=" -isysroot $targetSysroot -target x86_64-apple-ios14.1-macabi -I$ros2SystemDependenciesPath /include/" ;;
134
+
135
+ " macCatalyst_M1" )
136
+ export CFLAGS=" -isysroot $targetSysroot -target arm64-apple-ios14.1-macabi -I$ros2SystemDependenciesPath /include/" ;;
137
+
138
+ * )
139
+ export CFLAGS=" -isysroot $targetSysroot -arch $targetArch -I$ros2SystemDependenciesPath /include/" ;;
140
+ esac
111
141
export CXXFLAGS=$CFLAGS
112
142
export CPPFLAGS=$CFLAGS # Without this, encounter error ZLIB_VERNUM != PNG_ZLIB_VERNUM when building libpng
113
143
}
@@ -333,7 +363,8 @@ function buildPCL() {
333
363
function buildOpenCV() {
334
364
echo " Build OpenCV"
335
365
cd $ros2DependenciesSourceExtractionPath /opencv-4.6.0
336
- buildCMake -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_JAVA=OFF -DBUILD_OBJC=OFF -DBUILD_ZLIB=NO
366
+ # https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html
367
+ buildCMake -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_JAVA=OFF -DBUILD_OBJC=OFF -DBUILD_ZLIB=NO -DBUILD_OPENEXR=YES
337
368
}
338
369
339
370
function buildAll() {
@@ -384,8 +415,8 @@ case $targetPlatform in
384
415
buildBoost
385
416
buildOpenCV;;
386
417
387
- * ) # Build dependencies for ROS2 cartographer package
388
- echo " We currently do not build any dependencies for iOS " ;;
418
+ * ) # Build useful dependencies for iOS
419
+ buildTinyXML2 ;;
389
420
esac
390
421
391
422
cd $REPO_ROOT
0 commit comments