Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt does properly native MacOS with Xcode #32

Open
tlanc007 opened this issue Apr 26, 2019 · 5 comments
Open

CMakeLists.txt does properly native MacOS with Xcode #32

tlanc007 opened this issue Apr 26, 2019 · 5 comments
Assignees

Comments

@tlanc007
Copy link

The logic in the CMakeLists.txt doesn't recognize the native MacOS (Xcode) compiler as a clang compiler. The result is that the examples won't build as the search paths and compiler options are wrong.

The work around is to specify a true clang/llvm compiler when running cmake.

@jefftrull
Copy link
Contributor

Would it be correct to rename this issue as follows: "Fails to build under MacOS with XCode"?

@jefftrull jefftrull self-assigned this May 1, 2019
@tlanc007 tlanc007 changed the title CMakeLists.txt does properly native MacOS compiler CMakeLists.txt does properly native MacOS with Xcode May 1, 2019
@tlanc007
Copy link
Author

tlanc007 commented May 1, 2019

Sure. I just renamed it.

@jefftrull
Copy link
Contributor

I had no trouble building on MacOS/Xcode using the develop branch. Here are the steps I used:

tar xjf ~/Downloads/boost_1_70_0.tar.bz
cd boost_1_70
./bootstrap.sh
./b2 --with-test --with-system --with-filesystem
cd ..
git clone https://github.com/cierelabs/boostache.git
cd boostache
git checkout develop
mkdir build
cd build
cmake -G Xcode -DBOOST_ROOT=~/work/ciere/boost_1_70_0 ..
xcodebuild -scheme ALL_BUILD
# test
examples/Debug/example1 # etc.

@tlanc007
Copy link
Author

tlanc007 commented May 2, 2019

Sorry, I wasn't clear. I wasn't referring to the Xcode as a generator. There is an issue when using the native compiler for Makefile generation. That is why I didn't use Xcode as the original subject.

cmake -DBoost_NO_BOOST_CMAKE=true -G "Unix Makefiles" ..

The -std option is never passed to the compiler and so there will be errors like:

boostache/include/boost/boostache/vm/traits.hpp:76:32: error:
a space is required between consecutive right angle brackets (use '> >')
struct is_map<std::map<T1,T2>>

But:
CC=clang CXX=clang++ cmake -DBoost_NO_BOOST_CMAKE=true -G "Unix Makefiles" ..

is fine, assuming one's path is pointing to different compilers than the native ones provided by Xcode.

@jefftrull
Copy link
Contributor

I'm not seeing this issue...

For Unix Makefiles it finds (without my help) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

I used cmake -G "Unix Makefiles" -DBOOST_ROOT=/blah/blah .. without any special environment changes. Adding -DBoost_NO_BOOST_CMAKE=true makes no difference.

I wonder if it's an Xcode setup issue. I did have to do sudo xcode-select --reset for the Xcode generator previously. Maybe try it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants