Commit 2441a7a0 authored by Marco Serantoni's avatar Marco Serantoni

[MacOSX] Treats LLVM as GCC + adds support for boost multiple...

[MacOSX] Treats LLVM as GCC + adds support for boost multiple processor(ppc/intel) and address(32/64 bit)
parent ff6a7e64
...@@ -75,10 +75,10 @@ mark_as_advanced( KICAD_USER_CONFIG_DIR ) ...@@ -75,10 +75,10 @@ mark_as_advanced( KICAD_USER_CONFIG_DIR )
#================================================ #================================================
# Set flags for GCC. # Set flags for GCC, or treat llvm as GCC
#================================================ #================================================
if( CMAKE_COMPILER_IS_GNUCXX ) if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION OUTPUT_VARIABLE GCC_VERSION
...@@ -157,7 +157,7 @@ if( CMAKE_COMPILER_IS_GNUCXX ) ...@@ -157,7 +157,7 @@ if( CMAKE_COMPILER_IS_GNUCXX )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" )
endif() endif()
endif( CMAKE_COMPILER_IS_GNUCXX ) endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if( KICAD_KEEPCASE ) if( KICAD_KEEPCASE )
add_definitions( -DKICAD_KEEPCASE ) add_definitions( -DKICAD_KEEPCASE )
......
...@@ -113,6 +113,33 @@ else() ...@@ -113,6 +113,33 @@ else()
unset( b2_libs ) unset( b2_libs )
endif() endif()
if( APPLE )
# I set this to being compatible with wxWidgets
# wxWidgets still using libstdc++ (gcc), meanwhile OSX
# has switched to libc++ (llvm) by default
set(BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=10.5" )
set(BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=10.5" )
if( CMAKE_OSX_ARCHITECTURES )
if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
(CMAKE_OSX_ARCHITECTURES MATCHES "64"))
message("-- BOOST found 32/64 Address Model")
set(BOOST_ADDRESSMODEL "address-model=32_64")
endif()
if( (${CMAKE_OSX_ARCHITECTURES} MATCHES "x86_64" OR ${CMAKE_OSX_ARCHITECTURES} MATCHES "386") AND
(${CMAKE_OSX_ARCHITECTURES} MATCHES "ppc"))
message("-- BOOST found ppc/intel Architecture")
set(BOOST_ARCHITECTURE "architecture=combined")
endif()
endif()
endif()
ExternalProject_Add( boost ExternalProject_Add( boost
PREFIX "${PREFIX}" PREFIX "${PREFIX}"
DOWNLOAD_DIR "${DOWNLOAD_DIR}" DOWNLOAD_DIR "${DOWNLOAD_DIR}"
...@@ -139,8 +166,11 @@ ExternalProject_Add( boost ...@@ -139,8 +166,11 @@ ExternalProject_Add( boost
BUILD_COMMAND ./b2 BUILD_COMMAND ./b2
variant=release variant=release
threading=multi threading=multi
toolset=gcc
${PIC_STUFF} ${PIC_STUFF}
${BOOST_CXXFLAGS}
${BOOST_LINKFLAGS}
${BOOST_ADDRESSMODEL}
${BOOST_ARCHITECTURE}
${b2_libs} ${b2_libs}
#link=static #link=static
--prefix=<INSTALL_DIR> --prefix=<INSTALL_DIR>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment