toolchains: remove platform prefix so that one can use TOOLCHAIN_XXX everywhere

parent e6ac49d9
......@@ -129,7 +129,7 @@ else()
"--disable-iconv"
"--disable-mmx"
"--enable-cross-compile"
"--cross-prefix=${ANDROID_TOOLCHAIN_PATH}/"
"--cross-prefix=${TOOLCHAIN_PATH}/"
"--sysroot=${CMAKE_SYSROOT}"
)
set(EP_ffmpeg_TARGET_OS "linux")
......
......@@ -52,9 +52,9 @@ else()
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"msvc\"")
elseif(ANDROID)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armeabi-v7a")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"android\" NDKROOT=\"${ANDROID_NDK_PATH}\" TOOLCHAINPREFIX=\"${ANDROID_TOOLCHAIN_PREFIX}\" TARGET=\"android-${CMAKE_ANDROID_API}\" ARCH=\"arm\"")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"android\" NDKROOT=\"${ANDROID_NDK_PATH}\" TOOLCHAINPREFIX=\"${TOOLCHAIN_PREFIX}\" TARGET=\"android-${CMAKE_ANDROID_API}\" ARCH=\"arm\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"android\" NDKROOT=\"${ANDROID_NDK_PATH}\" TOOLCHAINPREFIX=\"${ANDROID_TOOLCHAIN_PREFIX}\" TARGET=\"android-${CMAKE_ANDROID_API}\" ARCH=\"x86\"")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"android\" NDKROOT=\"${ANDROID_NDK_PATH}\" TOOLCHAINPREFIX=\"${TOOLCHAIN_PREFIX}\" TARGET=\"android-${CMAKE_ANDROID_API}\" ARCH=\"x86\"")
endif()
elseif(APPLE)
if(IOS)
......
......@@ -30,10 +30,14 @@ endif()
file(GLOB OPENH264_LIBS "${INSTALL_PREFIX}/lib/libopenh264.*.dylib")
foreach(OPENH264_LIB IN LISTS ${OPENH264_LIBS})
string(REGEX REPLACE ".+/(libopenh264\..\.dylib)$"
string(REGEX REPLACE ".+/(libopenh264\..\.dylib)$"
"@rpath/\1"
OPENH264_LIB_ID
${OPENH264_LIB}
)
execute_process(COMMAND install_name_tool -id ${OPENH264_LIB_ID} ${OPENH264_LIB})
endforeach()
if(EXISTS ${INSTALL_PREFIX}/lib/libopenh264.a AND TOOLCHAIN_RANLIB)
execute_process(COMMAND "${TOOLCHAIN_RANLIB}" "${INSTALL_PREFIX}/lib/libopenh264.a")
endif()
......@@ -701,7 +701,7 @@ macro(linphone_builder_add_external_project PROJNAME)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/postinstall.cmake)
ExternalProject_Add_Step(EP_${PROJNAME} postinstall
COMMAND ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DINSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/postinstall.cmake
COMMAND ${CMAKE_COMMAND} -DTOOLCHAIN_RANLIB=${TOOLCHAIN_RANLIB} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DINSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/postinstall.cmake
COMMENT "Performing post-installation for 'EP_${PROJNAME}'"
DEPENDEES install
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
......
#!/bin/sh
@ANDROID_TOOLCHAIN_STRIP@ $*
\ No newline at end of file
@TOOLCHAIN_STRIP@ $*
......@@ -56,7 +56,7 @@ find_file(CLANG_EXECUTABLE "clang"
)
if(CLANG_EXECUTABLE)
get_filename_component(ANDROID_TOOLCHAIN_PATH "${CLANG_EXECUTABLE}" DIRECTORY)
get_filename_component(TOOLCHAIN_PATH "${CLANG_EXECUTABLE}" DIRECTORY)
set(GCC_VERSION "4.9")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armeabi-v7a")
set(GCC_LIBRARY_ADDITIONAL_DIR "/armv7-a")
......@@ -107,8 +107,8 @@ if(CLANG_EXECUTABLE)
set(CMAKE_CXX_COMPILER_TARGET "${CLANG_TARGET}")
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${EXTERNAL_TOOLCHAIN_PATH}/..")
set(ANDROID_TOOLCHAIN_PREFIX "${EXTERNAL_TOOLCHAIN_PATH}/${COMPILER_PREFIX}-")
set(ANDROID_TOOLCHAIN_STRIP "${ANDROID_TOOLCHAIN_PREFIX}strip")
set(TOOLCHAIN_PREFIX "${EXTERNAL_TOOLCHAIN_PATH}/${COMPILER_PREFIX}-")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_PREFIX}strip")
else()
......@@ -127,20 +127,20 @@ else()
if(NOT GCC_EXECUTABLE)
message(FATAL_ERROR "Cannot find the compiler")
endif()
get_filename_component(ANDROID_TOOLCHAIN_PATH "${GCC_EXECUTABLE}" DIRECTORY)
get_filename_component(TOOLCHAIN_PATH "${GCC_EXECUTABLE}" DIRECTORY)
set(ANDROID_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_PATH}/${COMPILER_PREFIX}-")
set(ANDROID_TOOLCHAIN_CC "${ANDROID_TOOLCHAIN_PREFIX}gcc")
set(ANDROID_TOOLCHAIN_CXX "${ANDROID_TOOLCHAIN_PREFIX}g++")
set(ANDROID_TOOLCHAIN_LD "${ANDROID_TOOLCHAIN_PREFIX}ld")
set(ANDROID_TOOLCHAIN_AR "${ANDROID_TOOLCHAIN_PREFIX}ar")
set(ANDROID_TOOLCHAIN_RANLIB "${ANDROID_TOOLCHAIN_PREFIX}ranlib")
set(ANDROID_TOOLCHAIN_STRIP "${ANDROID_TOOLCHAIN_PREFIX}strip")
set(ANDROID_TOOLCHAIN_NM "${ANDROID_TOOLCHAIN_PREFIX}nm")
set(TOOLCHAIN_PREFIX "${TOOLCHAIN_PATH}/${COMPILER_PREFIX}-")
set(TOOLCHAIN_CC "${TOOLCHAIN_PREFIX}gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_PREFIX}g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_PREFIX}ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_PREFIX}ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_PREFIX}ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_PREFIX}strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_PREFIX}nm")
# Define the compiler
CMAKE_FORCE_C_COMPILER("${ANDROID_TOOLCHAIN_CC}" GNU)
CMAKE_FORCE_CXX_COMPILER("${ANDROID_TOOLCHAIN_CXX}" GNU)
CMAKE_FORCE_C_COMPILER("${TOOLCHAIN_CC}" GNU)
CMAKE_FORCE_CXX_COMPILER("${TOOLCHAIN_CXX}" GNU)
endif()
......
......@@ -52,8 +52,8 @@ if(COMPILER_PATH STREQUAL "")
endif()
get_filename_component(COMPILER_NAME ${COMPILER_PATH} NAME)
string(REGEX REPLACE "-gcc$" "" BB10_TOOLCHAIN_PATH ${COMPILER_PATH})
string(REGEX REPLACE "-gcc$" "" BB10_TOOLCHAIN_HOST ${COMPILER_NAME})
string(REGEX REPLACE "-gcc$" "" TOOLCHAIN_PATH ${COMPILER_PATH})
string(REGEX REPLACE "-gcc$" "" TOOLCHAIN_HOST ${COMPILER_NAME})
if("${SYSTEM_PROCESSOR}" STREQUAL "arm")
SET(arch gcc_ntoarmv7le)
......@@ -63,21 +63,21 @@ endif()
foreach(TOOLNAME gcc g++ ld)
SET(TOOLPATH "${QNX_HOST}/usr/bin/qcc -V${arch}")
configure_file(${CMAKE_CURRENT_LIST_DIR}/tool_wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-${TOOLNAME})
configure_file(${CMAKE_CURRENT_LIST_DIR}/tool_wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-${TOOLNAME})
endforeach(TOOLNAME)
foreach(TOOLNAME ar ranlib strip nm as)
set(TOOLPATH "${BB10_TOOLCHAIN_PATH}-${TOOLNAME}")
configure_file(${CMAKE_CURRENT_LIST_DIR}/tool_wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-${TOOLNAME})
set(TOOLPATH "${TOOLCHAIN_PATH}-${TOOLNAME}")
configure_file(${CMAKE_CURRENT_LIST_DIR}/tool_wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-${TOOLNAME})
endforeach(TOOLNAME)
set(BB10_TOOLCHAIN_CC "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-gcc")
set(BB10_TOOLCHAIN_CXX "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-g++")
set(BB10_TOOLCHAIN_LD "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-ld")
set(BB10_TOOLCHAIN_AR "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-ar")
set(BB10_TOOLCHAIN_RANLIB "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-ranlib")
set(BB10_TOOLCHAIN_STRIP "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-strip")
set(BB10_TOOLCHAIN_NM "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-nm")
set(BB10_TOOLCHAIN_AS "${CMAKE_CURRENT_BINARY_DIR}/${BB10_TOOLCHAIN_HOST}-as")
set(TOOLCHAIN_CC "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-nm")
set(TOOLCHAIN_AS "${CMAKE_CURRENT_BINARY_DIR}/${TOOLCHAIN_HOST}-as")
set(QNX True)
......@@ -90,8 +90,8 @@ set(CMAKE_SYSTEM_NAME QNX)
set(CMAKE_SYSTEM_PROCESSOR ${SYSTEM_PROCESSOR})
# Define the compiler
CMAKE_FORCE_C_COMPILER(${BB10_TOOLCHAIN_CC} GNU)
CMAKE_FORCE_CXX_COMPILER(${BB10_TOOLCHAIN_CXX} GNU)
CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_CC} GNU)
CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_CXX} GNU)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_INSTALL_PREFIX} ${QNX_TARGET} ${QNX_TARGET}/${ROOT_PATH_SUFFIX})
......
......@@ -56,26 +56,26 @@ endif()
execute_process(COMMAND xcrun --sdk iphone${PLATFORM_LOWER} --find clang
RESULT_VARIABLE XCRUN_FIND_CLANG_RESULT
OUTPUT_VARIABLE IOS_CLANG_PATH
OUTPUT_VARIABLE CLANG_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT ${XCRUN_FIND_CLANG_RESULT} EQUAL 0)
message(FATAL_ERROR "xcrun failed: ${XCRUN_FIND_CLANG_RESULT}. You may need to install Xcode.")
endif()
get_filename_component(IOS_TOOLCHAIN_PATH "${IOS_CLANG_PATH}" DIRECTORY)
get_filename_component(TOOLCHAIN_PATH "${CLANG_PATH}" DIRECTORY)
message(STATUS "Using sysroot path: ${CMAKE_OSX_SYSROOT}")
message(STATUS "Using sdk version: ${IOS_SDK_VERSION}")
set(SDK_BIN_PATH "${CMAKE_OSX_SYSROOT}/../../usr/bin")
set(IOS_TOOLCHAIN_CC "${IOS_TOOLCHAIN_PATH}/clang")
set(IOS_TOOLCHAIN_CXX "${IOS_TOOLCHAIN_PATH}/clang++")
set(IOS_TOOLCHAIN_OBJC "${IOS_TOOLCHAIN_PATH}/clang")
set(IOS_TOOLCHAIN_LD "${IOS_TOOLCHAIN_PATH}/ld")
set(IOS_TOOLCHAIN_AR "${IOS_TOOLCHAIN_PATH}/ar")
set(IOS_TOOLCHAIN_RANLIB "${IOS_TOOLCHAIN_PATH}/ranlib")
set(IOS_TOOLCHAIN_STRIP "${IOS_TOOLCHAIN_PATH}/strip")
set(IOS_TOOLCHAIN_NM "${IOS_TOOLCHAIN_PATH}/nm")
set(TOOLCHAIN_CC "${TOOLCHAIN_PATH}/clang")
set(TOOLCHAIN_CXX "${TOOLCHAIN_PATH}/clang++")
set(TOOLCHAIN_OBJC "${TOOLCHAIN_PATH}/clang")
set(TOOLCHAIN_LD "${TOOLCHAIN_PATH}/ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_PATH}/ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_PATH}/ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_PATH}/strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_PATH}/nm")
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERSION_RAW OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "Xcode ([^\n]*).*" "\\1" XCODE_VERSION "${XCODE_VERSION_RAW}")
......@@ -95,8 +95,8 @@ if(CMAKE_GENERATOR STREQUAL "Xcode")
endif()
# Define the compiler
CMAKE_FORCE_C_COMPILER(${IOS_TOOLCHAIN_CC} Clang)
CMAKE_FORCE_CXX_COMPILER(${IOS_TOOLCHAIN_CXX} Clang)
CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_CC} Clang)
CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_CXX} Clang)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} ${CMAKE_INSTALL_PREFIX})
# search for programs in the build host directories
......
......@@ -26,3 +26,4 @@ set(COMPILER_PREFIX "x86_64-apple-darwin")
set(PLATFORM "Simulator")
include("${CMAKE_CURRENT_LIST_DIR}/ios/toolchain-ios.cmake")
......@@ -25,17 +25,17 @@ if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
else()
set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(RASPBERRY_TOOLCHAIN_HOST "arm-linux-gnueabihf")
set(TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(RASPBERRY_TOOLCHAIN_CC "${RASPBERRY_TOOLCHAIN_HOST}-gcc")
set(RASPBERRY_TOOLCHAIN_CXX "${RASPBERRY_TOOLCHAIN_HOST}-g++")
set(RASPBERRY_TOOLCHAIN_LD "${RASPBERRY_TOOLCHAIN_HOST}-ld")
set(RASPBERRY_TOOLCHAIN_AR "${RASPBERRY_TOOLCHAIN_HOST}-ar")
set(RASPBERRY_TOOLCHAIN_RANLIB "${RASPBERRY_TOOLCHAIN_HOST}-ranlib")
set(RASPBERRY_TOOLCHAIN_STRIP "${RASPBERRY_TOOLCHAIN_HOST}-strip")
set(RASPBERRY_TOOLCHAIN_NM "${RASPBERRY_TOOLCHAIN_HOST}-nm")
set(TOOLCHAIN_CC "${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_HOST}-nm")
include(CMakeForceCompiler)
......@@ -47,8 +47,8 @@ set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "arm")
# Define the compiler
CMAKE_FORCE_C_COMPILER(${RASPBERRY_TOOLCHAIN_CC} GNU)
CMAKE_FORCE_CXX_COMPILER(${RASPBERRY_TOOLCHAIN_CXX} GNU)
CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_CC} GNU)
CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_CXX} GNU)
set(CMAKE_FIND_ROOT_PATH ${SYSROOT_PATH} ${CMAKE_INSTALL_PREFIX})
......
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