@@ -60,6 +60,14 @@ function ios_protobuf_printf_variable() {
6060
6161function ios_protobuf_pre_tool_check() {
6262
63+ # protobuf-3.11.4 need mac version > 10.3
64+ local mac_version=$( util_get_mac_version)
65+ local mac_version_list=($( echo ${mac_version} | sed " s/\./ /g" ) )
66+ if test ${# mac_version_list[@]} -lt 3; then
67+ common_die " get mac version error!"
68+ fi
69+ export MACOSX_DEPLOYMENT_TARGET=" ${mac_version_list[0]} .${mac_version_list[1]} "
70+
6371 local protobuf_version=$( protoc --version)
6472 util_is_in " $COMMON_LIBRARY_VERSION " " $protobuf_version " || common_die " Protobuf is not installed on the system, see the protobuf installation instructions. (ref: https://github.com/protocolbuffers/protobuf/blob/master/src/README.md)"
6573
@@ -114,10 +122,6 @@ function ios_protobuf_build_config_make() {
114122
115123 elif [[ " ${library_arch} " == " arm64" ]]; then
116124
117- # for test
118- export CFLAGS=' -arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Wno-ignored-optimization-argument -DIOS -fembed-bitcode -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include'
119- export CPPFLAGS=${CFLAGS}
120-
121125 ./configure --host=$( ios_get_build_host " ${library_arch} " ) --prefix=" ${library_arch_path} " --disable-shared --with-protoc=protobuf_command > " ${library_arch_path} /log/output.log" 2>&1 || common_die " configure error!"
122126
123127 elif [[ " ${library_arch} " == " arm64e" ]]; then
@@ -128,12 +132,17 @@ function ios_protobuf_build_config_make() {
128132 common_die " not support $library_arch "
129133 fi
130134
131- make clean >> " ${library_arch_path} /log/output.log"
132- if make -j$( util_get_cpu_count) >> " ${library_arch_path} /log/output.log" 2>&1 ; then
133- if make check >> " ${library_arch_path} /log/output.log" 2>&1 ; then
134- make install >> " ${library_arch_path} /log/output.log" 2>&1
135- fi
136- fi
135+ echo " [${COMMON_LIBRARY_NAME} _make_clean]" >> " ${library_arch_path} /log/output.log"
136+ make clean >> " ${library_arch_path} /log/output.log" 2>&1 || common_die " make clean error!"
137+
138+ echo " [${COMMON_LIBRARY_NAME} _make]" >> " ${library_arch_path} /log/output.log"
139+ make -j$( util_get_cpu_count) >> " ${library_arch_path} /log/output.log" 2>&1 || common_die " make error!"
140+
141+ # echo "[${COMMON_LIBRARY_NAME}_make_check]" >>"${library_arch_path}/log/output.log"
142+ # make check >>"${library_arch_path}/log/output.log" 2>&1 || common_die "make check error!"
143+
144+ echo " [${COMMON_LIBRARY_NAME} _make_install]" >> " ${library_arch_path} /log/output.log"
145+ make install >> " ${library_arch_path} /log/output.log" 2>&1 || common_die " make install error!"
137146
138147 popd
139148}
0 commit comments