faithfracture / Apple-Boost-BuildScript

Script for building Boost for Apple platforms (iOS, iOS Simulator, tvOS, tvOS Simulator, OS X)
279 stars 111 forks source link

Building framework should have an option to put the header files in Headers/boost #26

Closed mobileben closed 6 years ago

mobileben commented 6 years ago

Some libraries such as cpprestsdk expect boost to have "boost" in the path. For example: "boost/align.hpp".

It would be nice to have a switch to be able to build it this way.

Note that I use the static libs. But I'm working on iOS compatibility with cpprestsdk and wanted to test that my changes work with a boost framework.

https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-iOS

They actually now recommend your repo (although they didn't provide a link, it's referenced).

mobileben commented 6 years ago

I can create pull request for you if you want.

faithfracture commented 6 years ago

It's interesting that this is actually a problem. My project expects boost headers to be located in <boost/libname>, but I've never had a problem using the framework as is.

I can totally add an option to do that though. (Depending on how it affects my project, I may just make it the default, since it's more correct anyways.)

mobileben commented 6 years ago

Heh totally (meaning you should prioritize your projects). I was thinking you would just add an argument to handle that case.

It doesn't bother me since I use the static libs and modified cpprestsdk to also take the static libs. I was just checking the framework for completeness before doing a pull request on that project.

But since they mentioned your repo, thought I'd give the heads up.

faithfracture commented 6 years ago

Oh, they do mention it. That's cool.

My thought was that I'd make this the default and provide a parameter to switch back to the current behavior, so I don't break everyone else's projects. (But again, I'll only do that if it doesn't blow my project up. Selfish, I know :) )

faithfracture commented 6 years ago

They're using the old GIST too... I think I'll create an issue with them to use this repo instead, since that one doesn't work with the current version of Xcode (and I don't think it has for a while...)

mobileben commented 6 years ago

As a forewarning, they are slow to respond it seems regarding anything iOS. And it isn't clear to me why they didn't even put a link. I actually gave them a link to it here https://github.com/Microsoft/cpprestsdk/issues/436

Heh, be selfish ;). That's what forks are for. Anyways thanks, you saved me a ton of time. I'm usually the guy that has to decipher all the autoconf and do the static lib builds. But this was one of the rare times I could actually use something right out of the box. So it has been super helpful.

If you want me to test building and using on one of your branches, just let me know, I'll be happy to donate some CPU cycles.

aksswami commented 6 years ago

Just to point out, I also faced the same issue. I am also trying to use cpprestsdk across my desktop and mobile client and initially used their documentation for compiling boost for macOS and iOS, which point to outdated gist.

Anyway thanks for great work @faithfracture, As I am new to C++ and everything, this really helps a lot.

@mobileben I would really like to get in touch with you for this as you are also doing similar stuff. Thanks guys.

faithfracture commented 6 years ago

Ok, so it looks like when you include a framework in an Xcode project it assumes that everything in the Headers directory are already under a root directory with the same name of the framework. I.E., if the framework is called boost.framework, it's assumed that everything in the Headers directory will be included as "boost/someheader.hpp". So, I did not make having headers be under a boost parent directory the default. You will instead need to pass the --framework-headers-root flag to the script.

Fixed in commit 9d3b873028d7a49e883a8ed06cc8086b3165a510

aksswami commented 6 years ago

Thanks for quick response and update @faithfracture