Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CMake settings for Xcode 4.3 and LLVM 3.1  (Read 1860 times)

0 Members and 1 Guest are viewing this topic.

s73v3r

  • Newbie
  • *
  • Posts: 3
    • View Profile
CMake settings for Xcode 4.3 and LLVM 3.1
« on: February 26, 2012, 09:37:49 am »
Does anyone know the options that need to be set in CMake to use LLVM 3.1 and it's stdlib?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
CMake settings for Xcode 4.3 and LLVM 3.1
« Reply #1 on: February 26, 2012, 07:30:40 pm »
I don't know (yet).

But for the record : Xcode 4.3 is not (yet) supported.
SFML / OS X developer

s73v3r

  • Newbie
  • *
  • Posts: 3
    • View Profile
CMake settings for Xcode 4.3 and LLVM 3.1
« Reply #2 on: March 02, 2012, 01:39:44 am »
Is compiling under Clang with C++11 supported?

s73v3r

  • Newbie
  • *
  • Posts: 3
    • View Profile
CMake settings for Xcode 4.3 and LLVM 3.1
« Reply #3 on: March 02, 2012, 03:36:01 am »
I got it kinda working. At least well enough to where my project now compiles using C++11 and the C++11 stdlib under Clang in Xcode.

Here's what I did:
I had CMake generate files for Xcode. I then opened the SFML project generated in Xcode, and set the appropriate flags under the Language settings for -std=c++11, and the same for the std library.

After that, I built using the ALL_BUILD target. Everything should compile just fine. Next, when going to use the install target, things should build and compile, but it should choke on the copying of the files.

When this happens, you can try to get stuff set up so that sudo can read from a file what to do when it can't ask for the password. Or you can do what I did. I went to the Terminal, and ran the command that failed (executing the cmake install script, which is there in the directory you output the Xcode project files to) under sudo manually. It will copy all of the libraries to their appropriate places.

Then you can go into your project, enable the same C++11 settings, and enjoy using auto, range-for, nullptr, and all of the other warm C++11 goodness (that LLVM supports at that time, at least).

I hope this helps someone, until SFML is updated, cause I was having a hell of a time with it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CMake settings for Xcode 4.3 and LLVM 3.1
« Reply #4 on: March 02, 2012, 07:59:38 am »
Quote
I then opened the SFML project generated in Xcode, and set the appropriate flags under the Language settings for -std=c++11, and the same for the std library

You can add these settings to the CMAKE_CXX_FLAGS (compiler) and CMAKE_EXE_LINKER_FLAGS (linker for executables) or CMAKE_SHARED_LINKER_FLAGS (linker for shared libraries) variables when you configure your project.

Quote
I hope this helps someone, until SFML is updated, cause I was having a hell of a time with it.

Updated to do what? If all you did was to add specific compiler and linker flags, there's nothing do for me.
Laurent Gomila - SFML developer

 

anything