Comments (4)
Hmm.. I'll have to verify this at work tomorrow. But it seems some of the flags are being overridden somehow by the CMakeLists.txt in the protobuf project. Is it the standard google protobuf repo you are trying to build with the toolchain?
from ios-cmake.
Yes, standard repo (not the latest master though), but the build process is somewhat not trivial, because build requires some binaries on host system:
git clone https://github.com/google/protobuf
(cd ./protobuf ; git checkout 80a37e0782d2d702d52234b62dd4b9ec74fd2c95)
cmake -DCMAKE_BUILD_TYPE=Debug -Dprotobuf_BUILD_TESTS=OFF -H./protobuf/cmake -B./protobuf/host_build # build for host to get js_embed
VERBOSE=1 cmake --build ./protobuf/host_build
sed -i .bak "s~COMMAND js_embed~COMMAND $(pwd)/protobuf/host_build/js_embed~" ./protobuf/cmake/libprotoc.cmake
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$(pwd)/ios-cmake/ios.toolchain.cmake -DIOS_PLATFORM=SIMULATOR -DCMAKE_INSTALL_PREFIX=./dependencies -Dprotobuf_BUILD_TESTS=OFF -H./protobuf/cmake -B./protobuf/.build
VERBOSE=1 cmake --build ./protobuf/.build --target install
from ios-cmake.
So, i have now checked the situation, and it all seems very reasonable for Apple not to include bitcode in ARClite for simulator builds. Bitcode is only used by Apple for recompiling the binary blobs for newer SDKs and such. And since simulator slices are removed (more like prohibited by Apple) in AppStore-builds, there is little to no reason for them to supply bitcode in ARClite for simulator builds.
After digging through the protobuf code, my recommendation to you is to simply build libprotobuf without ARC, by supplying -DENABLE_ARC=0
.
So, the correct commands would look like:
git clone https://github.com/google/protobuf
(cd ./protobuf ; git checkout 80a37e0782d2d702d52234b62dd4b9ec74fd2c95)
cmake -DCMAKE_BUILD_TYPE=Debug -Dprotobuf_BUILD_TESTS=OFF -H./protobuf/cmake -B./protobuf/host_build # build for host to get js_embed
VERBOSE=1 cmake --build ./protobuf/host_build
sed -i .bak "s~COMMAND js_embed~COMMAND $(pwd)/protobuf/host_build/js_embed~" ./protobuf/cmake/libprotoc.cmake
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$(pwd)/ios-cmake/ios.toolchain.cmake -DIOS_PLATFORM=SIMULATOR -DENABLE_ARC=0 -DCMAKE_INSTALL_PREFIX=./dependencies -Dprotobuf_BUILD_TESTS=OFF -H./protobuf/cmake -B./protobuf/.build
VERBOSE=1 cmake --build ./protobuf/.build --target install
The resulting files under .dependencies
will contain the LLVM slices required.
This way, you would be able to build with bitcode (but with ARC disabled for libprotobuf, since it seems that there is no need for it), even for the simulator (to ease one´s life a little). :)
from ios-cmake.
I will close this issue, since it is more a problem with documentation of the protobuf library, than an error with this toolchain.
from ios-cmake.
Related Issues (20)
- [bug] Should set ENABLE_STRICT_TRY_COMPILE TRUE by default HOT 5
- [bug] The platform OS64COMBINED generate Xcode project only for iOS HOT 1
- Feature: Add Support for Universal macOS builds (Apple Silicon + Intel) HOT 2
- [bug] build fail for SIMULATOR64 with xcode 14 HOT 2
- [question] Issue with APPLE_TARGET_TRIPLE (aarch64-apple-ios/arm64-apple-ios) HOT 5
- how to omit -G Xcode to use Makefile or use -G Ninjau HOT 2
- Honor CMAKE_FIND_FRAMEWORK if passed via command line
- [bug] Support for SIMULATORARM64_TVOS only HOT 2
- [bug] Support for OS only for armv7 HOT 2
- [bug] MacCatalyst x86_64 is building with macOS flags and not macabi HOT 5
- Add support for visionOS HOT 11
- [bug] Intermediate binaries compiled during cmake build are not signed when using ios.toolchain.cmake HOT 3
- command not found: cmake HOT 2
- how to show the duplicate symbols HOT 1
- Copy-if-different error while trying to build brainflow libraries using OS64COMBINED HOT 1
- ARM64 support for WATCHOS simulator is missing. HOT 2
- [bug] CMAKE_OSX_DEPLOYMENT_TARGET not CACHE HOT 2
- what's the different about release version and debug version? HOT 1
- the compiled framework contains only arm64
- [bug] building for iOS, but linking in object file built for iOS Simulator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-cmake.