More tweaks for building with Xcode
This commit is contained in:
parent
fd3cf1e56d
commit
6059e68c4f
@ -20,6 +20,21 @@ project( YouCompleteMe )
|
|||||||
|
|
||||||
option( UNIVERSAL "Build universal mac binary" OFF )
|
option( UNIVERSAL "Build universal mac binary" OFF )
|
||||||
|
|
||||||
|
if ( CMAKE_GENERATOR STREQUAL Xcode )
|
||||||
|
set( CMAKE_GENERATOR_IS_XCODE true )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" )
|
||||||
|
set( SYSTEM_IS_FREEBSD true )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check if platform is 64 bit
|
||||||
|
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
|
||||||
|
set( 64_BIT_PLATFORM 0 )
|
||||||
|
else()
|
||||||
|
set( 64_BIT_PLATFORM 1 )
|
||||||
|
endif()
|
||||||
|
|
||||||
# Turning on this flag tells cmake to emit a compile_commands.json file.
|
# Turning on this flag tells cmake to emit a compile_commands.json file.
|
||||||
# This file can be used to load compilation flags into YCM. See here for more
|
# This file can be used to load compilation flags into YCM. See here for more
|
||||||
# details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
# details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
||||||
@ -48,14 +63,6 @@ if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if ( CMAKE_GENERATOR STREQUAL Xcode )
|
|
||||||
set( CMAKE_GENERATOR_IS_XCODE true )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if ( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" )
|
|
||||||
set( SYSTEM_IS_FREEBSD true )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Force release build by default, speed is of the essence
|
# Force release build by default, speed is of the essence
|
||||||
if ( NOT CMAKE_BUILD_TYPE )
|
if ( NOT CMAKE_BUILD_TYPE )
|
||||||
set( CMAKE_BUILD_TYPE Release )
|
set( CMAKE_BUILD_TYPE Release )
|
||||||
@ -71,6 +78,8 @@ if ( CMAKE_COMPILER_IS_GNUCXX )
|
|||||||
endif()
|
endif()
|
||||||
elseif( COMPILER_IS_CLANG )
|
elseif( COMPILER_IS_CLANG )
|
||||||
set( CPP11_AVAILABLE true )
|
set( CPP11_AVAILABLE true )
|
||||||
|
set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
|
||||||
|
set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# When used with Clang, adding the -std=c++0x flag to CMAKE_CXX_FLAGS will cause
|
# When used with Clang, adding the -std=c++0x flag to CMAKE_CXX_FLAGS will cause
|
||||||
@ -90,12 +99,5 @@ else()
|
|||||||
"Your C++ compiler does NOT support C++11, compiling in C++03 mode." )
|
"Your C++ compiler does NOT support C++11, compiling in C++03 mode." )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check if platform is 64 bit
|
|
||||||
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
|
|
||||||
set( 64_BIT_PLATFORM 0 )
|
|
||||||
else()
|
|
||||||
set( 64_BIT_PLATFORM 1 )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory( BoostParts )
|
add_subdirectory( BoostParts )
|
||||||
add_subdirectory( ycm )
|
add_subdirectory( ycm )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user