Comments (10)
Try to install headers to include
directory. Explanation: this is workaround script which expect only one file in lib
folder (which should be the *.a
library) so when there are some other files script can't decide what file is a library.
Just for your information there are few fixes in latest CMake version that allow creating frameworks without hacks/workarounds (just using CMake). I haven't tried it yet, but if it works okay --framework
option will be removed.
from polly.
Still using make 3.3
cmake_minimum_required(VERSION 3.3)
I added the FRAMEWORK property
set_target_properties(
foo PROPERTIES
FRAMEWORK TRUE
PUBLIC_HEADER public.h)
Then I built using the following command
./buildtools/polly/bin/build.py --clear --toolchain xcode
This created a Framework with 'public.h' in the Headers folder located at:
_builds/xcode/Debug/foo.framework
But this only appears to be a MAC OS X framework not a fat Framework, I ran the file command:
file _builds/xcode/Debug/foo.framework/foo
result was:
Mach-O 64-bit dynamically linked shared library x86_64
I also tried --toolchain ios-9-2 but the framework still appears to be created only for x86_64
from polly.
But this only appears to be a MAC OS X framework not a fat Framework
This is by design. Fat library created only for iOS.
I also tried --toolchain ios-9-2 but the framework still appears to be created only for x86_64
I will test latest CMake version with few improvements, may be will create an example.
from polly.
What is the correct way to configure the public headers for a framework build
Okay, I think I know what is the problem here. --framework
option expect headers be located in directory <install-prefix>/include/<frameworkname>
. I.e. if you have library libfoo.dylib
installed, then headers should be located in <install-prefix>/include/foo
and will be moved to foo.framework/Headers
. The reason of this is that project which uses foo
should do #include <foo/*.hpp>
in both variants. I've added warning to build.py
script, so you should see next message:
Warning: no headers found for framework (dir: /.../_install/ios-9-1-armv7/include/boo)
Which can be fixed by next CMake code:
install(FILES boo.hpp DESTINATION include/boo)
I also tried --toolchain ios-9-2 but the framework still appears to be created only for x86_64
Are you sure you're using patched CMake version?
- https://github.com/ruslo/polly/wiki/Toolchain-list#ios
- https://github.com/ruslo/hunter#notes-about-version-of-cmake
from polly.
Example with framework and native Xcode project updated:
from polly.
Great! I have successfully built and linked the ios-dynamic-framework project.
I did have to use patched CMake version, I tried with the latest 3.5.0-rc2 CMake but that failed to build the Fat framework bundle.
I'm going to try and replicate the project setup to my own library repo.
from polly.
but that failed to build the Fat framework bundle
With CMake 3.5+ you have to use CMAKE_IOS_INSTALL_COMBINED=YES
and CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO
and run install (no need to use --framework
, now it's --install
). However dynamic framework will not be signed properly so the last time I've tried it I failed to run bundle on real device.
from polly.
I have replicated the demo project setup on my own repo, I did not copy over the custom jenkins.py as I am just trying to build a dynamic library component, I am calling build.py directly with:
./buildtools/polly/bin/build.py --clear --toolchain ios-9-2 --framework --config Release
The build is successful and the lib binary now reports as a Fat lib and the public header is copied over to the framework/Headers folder.
I have noticed that if I build with --config Debug, that 'd' gets appended to the project name for all folders and files and it also causes the public header not to get copied to framework/Headers (unless I install it to an include/'d' folder.
Is there a way to prevent the 'd' suffix getting added and maybe create the framework under a debug or release folder depending on the --config value.
from polly.
Is there a way to prevent the 'd' suffix getting added
Set it in command line -DCMAKE_DEBUG_POSTFIX=""
, in terms of build.py
script it will be --fwd CMAKE_DEBUG_POSTFIX=""
from polly.
Both iOS and OSX framework builds are working, thanks.
from polly.
Related Issues (20)
- mingw cross compilation from Linux to Windows HOT 9
- CHECK_TYPE_SIZE iOS error HOT 4
- Clang Compiler Test Failing For iOS-10-3-armv7.cmake At Master Commit 3e3f903 HOT 21
- SwiftModule and -Swift.h ObjC compatibility header not copied to framework HOT 7
- xcode8 ios automatic provisioning HOT 1
- Additional C flags required for static-std.cmake to fix behaviour change in CMake HOT 1
- Problem codesigning iOS 11.2 with Xcode 9.2 (9C40b) HOT 5
- build details (active)
- reason for clearing IPHONEOS_DEPLOYMENT_TARGET HOT 4
- How to start for iOS? HOT 4
- --framework fails on codesign for multiple iPhone Developer certificate HOT 3
- ANDROID_NDK_rXX not set HOT 4
- Build failure on latest XCode (10A255) HOT 6
- add support for qnx HOT 2
- colorized ouput HOT 5
- Possible issue with NoCodeSign.xcconfig HOT 11
- "/usr/bin/ld: cannot find -lc++" when using the clang-lto toolchain file HOT 2
- How to reduce Xcodebuild log size? HOT 4
- Add support for Apple's Project Catalyst HOT 2
- Problem with CPack HOT 3
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 polly.