Commit f51ddf41 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Use good architecture and deployment target for Mac OS X build of Python module.

parent b5333391
......@@ -47,6 +47,7 @@ set(DEFAULT_VALUE_ENABLE_UNIT_TESTS OFF)
find_package(Doxygen REQUIRED)
find_package(PythonInterp REQUIRED)
# Global configuration
......@@ -54,12 +55,13 @@ set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) #
if (UNIX)
if(APPLE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
else()
set(CMAKE_OSX_ARCHITECTURES "i386")
endif()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/configs/python/mac_getplatform.py"
OUTPUT_VARIABLE MAC_PLATFORM
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(GET MAC_PLATFORM 0 CMAKE_OSX_DEPLOYMENT_TARGET)
list(GET MAC_PLATFORM 1 CMAKE_OSX_ARCHITECTURES)
set(LINPHONE_BUILDER_CPPFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(LINPHONE_BUILDER_OBJCFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(LINPHONE_BUILDER_LDFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
......
......@@ -23,10 +23,14 @@
cmake_minimum_required(VERSION 2.8.12)
project(PYLINPHONE C) # Dummy project
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PLATFORM_ARCH_NAME "x86_64")
if(APPLE)
set(PLATFORM_ARCH_NAME "${CMAKE_OSX_ARCHITECTURES}")
else()
set(PLATFORM_ARCH_NAME "i386")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PLATFORM_ARCH_NAME "x86_64")
else()
set(PLATFORM_ARCH_NAME "i386")
endif()
endif()
find_package(PythonInterp REQUIRED)
......@@ -199,7 +203,7 @@ endif()
if(UNIX)
if(APPLE)
set(PLATFORM_OS "macosx-10.5")
set(PLATFORM_OS "macosx-${CMAKE_OSX_DEPLOYMENT_TARGET}")
else()
set(PLATFORM_OS "linux")
endif()
......
#!/usr/bin/python
import distutils.util
import sys
def main(argv=None):
print(';'.join(distutils.util.get_platform().split('-')[1:]))
if __name__ == "__main__":
sys.exit(main())
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