Commit cae7a6ff authored by Marco Serantoni's avatar Marco Serantoni

[MacOSX] fixes issues with previous OSX compilers gcc-4.2 and makes a better...

[MacOSX] fixes issues with previous OSX compilers gcc-4.2 and makes a better general beaviour of KICAD_BUILD_STATIC
parent 6e586d69
...@@ -97,6 +97,13 @@ string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT ...@@ -97,6 +97,13 @@ string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT
# Default Toolset # Default Toolset
set( BOOST_TOOLSET "toolset=gcc" ) set( BOOST_TOOLSET "toolset=gcc" )
if( KICAD_BUILD_STATIC )
set(BOOST_LINKTYPE "link=static")
else()
set( BOOST_LINKTYPE "#link=static")
endif()
if( MINGW ) if( MINGW )
if( MSYS ) if( MSYS )
# The Boost system does not build properly on MSYS using bootstrap.sh. Running # The Boost system does not build properly on MSYS using bootstrap.sh. Running
...@@ -122,15 +129,19 @@ else() ...@@ -122,15 +129,19 @@ else()
unset( b2_libs ) unset( b2_libs )
endif() endif()
if( APPLE ) if( APPLE )
# I set this to being compatible with wxWidgets # I set this to being compatible with wxWidgets
# wxWidgets still using libstdc++ (gcc), meanwhile OSX # wxWidgets still using libstdc++ (gcc), meanwhile OSX
# has switched to libc++ (llvm) by default # has switched to libc++ (llvm) by default
set(BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=10.5 -fno-common -fno-lto" ) set(BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=10.5 -fno-common" )
set(BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=10.5 -fno-common -fno-lto" ) set(BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=10.5 -fno-common" )
set(BOOST_TOOLSET "toolset=darwin" ) set(BOOST_TOOLSET "toolset=darwin" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
endif()
if( CMAKE_OSX_ARCHITECTURES ) if( CMAKE_OSX_ARCHITECTURES )
if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
...@@ -142,9 +153,17 @@ if( APPLE ) ...@@ -142,9 +153,17 @@ if( APPLE )
if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND
(CMAKE_OSX_ARCHITECTURES MATCHES "ppc")) (CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
message("-- BOOST found ppc/intel Architecture") message("-- BOOST found ppc/x86 Architecture")
set(BOOST_ARCHITECTURE "architecture=combined") set(BOOST_ARCHITECTURE "architecture=combined")
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
message("-- BOOST found x86 Architecture")
set(BOOST_ARCHITECTURE "architecture=x86")
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
message("-- BOOST found ppc Architecture")
set(BOOST_ARCHITECTURE "architecture=ppc")
endif() endif()
set(BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" ) set(BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
...@@ -188,7 +207,7 @@ ExternalProject_Add( boost ...@@ -188,7 +207,7 @@ ExternalProject_Add( boost
${BOOST_ADDRESSMODEL} ${BOOST_ADDRESSMODEL}
${BOOST_ARCHITECTURE} ${BOOST_ARCHITECTURE}
${b2_libs} ${b2_libs}
#link=static ${BOOST_LINKTYPE}
--prefix=<INSTALL_DIR> --prefix=<INSTALL_DIR>
install install
......
...@@ -39,13 +39,18 @@ set( PREFIX ${DOWNLOAD_DIR}/cairo ) ...@@ -39,13 +39,18 @@ set( PREFIX ${DOWNLOAD_DIR}/cairo )
if (APPLE) if (APPLE)
if( CMAKE_OSX_ARCHITECTURES ) if( CMAKE_OSX_ARCHITECTURES )
set( CAIRO_CFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -fno-lto" ) set( CAIRO_CFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES}" )
set( CAIRO_LDFLAGS "LDFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -framework CoreGraphics -framework CoreServices" ) set( CAIRO_LDFLAGS "LDFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -framework CoreServices -framework Cocoa" )
set( CAIRO_OPTS "--enable-quartz-image" ) set( CAIRO_OPTS "--enable-quartz-image" )
endif( CMAKE_OSX_ARCHITECTURES ) endif( CMAKE_OSX_ARCHITECTURES )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set(CAIRO_CFLAGS "${CAIRO_CFLAGS} -fno-lto" )
endif()
if( CMAKE_OSX_SYSROOT ) if( CMAKE_OSX_SYSROOT )
set( CAIRO_CFLAGS "${CAIRO_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") #set( CAIRO_CFLAGS "${CAIRO_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
set( CAIRO_LDFLAGS "${CAIRO_LDFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
endif( CMAKE_OSX_SYSROOT) endif( CMAKE_OSX_SYSROOT)
endif(APPLE) endif(APPLE)
...@@ -72,10 +77,9 @@ ExternalProject_Add( cairo ...@@ -72,10 +77,9 @@ ExternalProject_Add( cairo
PKG_CONFIG=${PROJECT_SOURCE_DIR}/pkgconfig_root/bin/pkg-config PKG_CONFIG=${PROJECT_SOURCE_DIR}/pkgconfig_root/bin/pkg-config
PKG_CONFIG_PATH=${PROJECT_SOURCE_DIR}/pixman_root/lib/pkgconfig:${PROJECT_SOURCE_DIR}/libpng_root/lib/pkgconfig PKG_CONFIG_PATH=${PROJECT_SOURCE_DIR}/pixman_root/lib/pkgconfig:${PROJECT_SOURCE_DIR}/libpng_root/lib/pkgconfig
--enable-png=yes --enable-svg=yes --enable-png=yes --enable-svg=yes
--disable-silent-rules --disable-silent-rules --disable-dependency-tracking
${CAIRO_CFLAGS} ${CAIRO_CFLAGS}
${CAIRO_LDFLAGS} ${CAIRO_LDFLAGS}
CC=${CMAKE_C_COMPILER}
#BINARY_DIR "${PREFIX}" #BINARY_DIR "${PREFIX}"
......
...@@ -59,7 +59,7 @@ ExternalProject_Add( libpng ...@@ -59,7 +59,7 @@ ExternalProject_Add( libpng
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
#PATCH_COMMAND "true" #PATCH_COMMAND "true"
CONFIGURE_COMMAND ./configure --prefix=${LIBPNG_ROOT} --enable-static --disable-shared ${LIBPNG_CFLAGS} CONFIGURE_COMMAND ./configure --prefix=${LIBPNG_ROOT} --enable-static --disable-shared ${LIBPNG_CFLAGS} --disable-dependency-tracking
#BINARY_DIR "${PREFIX}" #BINARY_DIR "${PREFIX}"
BUILD_COMMAND make BUILD_COMMAND make
......
...@@ -59,7 +59,7 @@ ExternalProject_Add( pixman ...@@ -59,7 +59,7 @@ ExternalProject_Add( pixman
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
#PATCH_COMMAND "true" #PATCH_COMMAND "true"
CONFIGURE_COMMAND ./configure --prefix=${PIXMAN_ROOT} --enable-static=yes --enable-shared=no ${PIXMAN_CPPFLAGS} CC=${CMAKE_C_COMPILER} CONFIGURE_COMMAND ./configure --prefix=${PIXMAN_ROOT} --enable-static=yes --enable-shared=no ${PIXMAN_CPPFLAGS} --disable-dependency-tracking
#BINARY_DIR "${PREFIX}" #BINARY_DIR "${PREFIX}"
BUILD_COMMAND make BUILD_COMMAND make
......
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