Commit 5f41a7dd authored by Ghislain MARY's avatar Ghislain MARY

Pass flags derived from CMake build type to the autotools projects.

parent 03157e5b
......@@ -169,6 +169,24 @@ macro(linphone_builder_apply_toolchain_flags)
endmacro(linphone_builder_apply_toolchain_flags)
macro(linphone_builder_apply_cmake_flags_to_autotools_project PROJNAME)
if("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
set(BUILD_TYPES "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
list(FIND BUILD_TYPES "${CMAKE_BUILD_TYPE}" BUILD_TYPE_FOUND)
set(BUILD_TYPE_SUFFIX "")
if(NOT ${BUILD_TYPE_FOUND} EQUAL -1)
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
set(BUILD_TYPE_SUFFIX "_${UPPER_BUILD_TYPE}")
endif(NOT ${BUILD_TYPE_FOUND} EQUAL -1)
set(ep_asflags "${CMAKE_AS_FLAGS${BUILD_TYPE_SUFFIX}}")
set(ep_cppflags "${CMAKE_CPP_FLAGS${BUILD_TYPE_SUFFIX}}")
set(ep_cflags "${CMAKE_C_FLAGS${BUILD_TYPE_SUFFIX}}")
set(ep_cxxflags "${CMAKE_CXX_FLAGS${BUILD_TYPE_SUFFIX}}")
set(ep_ldflags "${CMAKE_LD_FLAGS${BUILD_TYPE_SUFFIX}}")
endif("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
endmacro(linphone_builder_apply_cmake_flags_to_autotools_project)
macro(linphone_builder_apply_extra_flags PROJNAME)
if("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
set(ep_extra_asflags ${EP_${PROJNAME}_EXTRA_ASFLAGS})
......@@ -236,6 +254,7 @@ endmacro(linphone_builder_create_configure_command)
function(linphone_builder_add_project PROJNAME)
linphone_builder_set_ep_directories(${PROJNAME})
linphone_builder_apply_cmake_flags_to_autotools_project(${PROJNAME})
linphone_builder_apply_extra_flags(${PROJNAME})
linphone_builder_expand_external_project_vars()
......
......@@ -9,12 +9,12 @@ export RANLIB=@LINPHONE_BUILDER_TOOLCHAIN_RANLIB@
export STRIP=@LINPHONE_BUILDER_TOOLCHAIN_STRIP@
export NM=@LINPHONE_BUILDER_TOOLCHAIN_NM@
export ASFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@ @ep_extra_asflags@"
export CPPFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@ @ep_extra_cppflags@"
export CFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@ @ep_extra_cflags@"
export CXXFLAGS="@LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@ @ep_extra_cxxflags@"
export OBJCFLAGS="@LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@ @ep_extra_objcflags@"
export LDFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@ @ep_extra_ldflags@"
export ASFLAGS="@ep_asflags@ @LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@ @ep_extra_asflags@"
export CPPFLAGS="@ep_cppflags@ @LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@ @ep_extra_cppflags@"
export CFLAGS="@ep_cflags@ @LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@ @ep_extra_cflags@"
export CXXFLAGS="@ep_cxxflags@ @LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@ @ep_extra_cxxflags@"
export OBJCFLAGS="@ep_objcflags@ @LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@ @ep_extra_objcflags@"
export LDFLAGS="@ep_ldflags@ @LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@ @ep_extra_ldflags@"
export PKG_CONFIG="@LINPHONE_BUILDER_PKG_CONFIG@"
export PKG_CONFIG_PATH="@LINPHONE_BUILDER_PKG_CONFIG_PATH@"
......
......@@ -9,12 +9,12 @@ export RANLIB=@LINPHONE_BUILDER_TOOLCHAIN_RANLIB@
export STRIP=@LINPHONE_BUILDER_TOOLCHAIN_STRIP@
export NM=@LINPHONE_BUILDER_TOOLCHAIN_NM@
export ASFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@ @ep_extra_asflags@"
export CPPFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@ @ep_extra_cppflags@"
export CFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@ @ep_extra_cflags@"
export CXXFLAGS="@LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@ @ep_extra_cxxflags@"
export OBJCFLAGS="@LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@ @ep_extra_objcflags@"
export LDFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@ @ep_extra_ldflags@"
export ASFLAGS="@ep_asflags@ @LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@ @ep_extra_asflags@"
export CPPFLAGS="@ep_cppflags@ @LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@ @ep_extra_cppflags@"
export CFLAGS="@ep_cflags@ @LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@ @ep_extra_cflags@"
export CXXFLAGS="@ep_cxxflags@ @LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@ @ep_extra_cxxflags@"
export OBJCFLAGS="@ep_objcflags@ @LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@ @ep_extra_objcflags@"
export LDFLAGS="@ep_ldflags@ @LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@ @ep_extra_ldflags@"
export PKG_CONFIG="@LINPHONE_BUILDER_PKG_CONFIG@"
export PKG_CONFIG_PATH="@LINPHONE_BUILDER_PKG_CONFIG_PATH@"
......
......@@ -9,12 +9,12 @@ export RANLIB=@LINPHONE_BUILDER_TOOLCHAIN_RANLIB@
export STRIP=@LINPHONE_BUILDER_TOOLCHAIN_STRIP@
export NM=@LINPHONE_BUILDER_TOOLCHAIN_NM@
export ASFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@ @ep_extra_asflags@"
export CPPFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@ @ep_extra_cppflags@"
export CFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@ @ep_extra_cflags@"
export CXXFLAGS="@LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@ @ep_extra_cxxflags@"
export OBJCFLAGS="@LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@ @ep_extra_objcflags@"
export LDFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@ @ep_extra_ldflags@"
export ASFLAGS="@ep_asflags@ @LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@ @ep_extra_asflags@"
export CPPFLAGS="@ep_cppflags@ @LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@ @ep_extra_cppflags@"
export CFLAGS="@ep_cflags@ @LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@ @ep_extra_cflags@"
export CXXFLAGS="@ep_cxxflags@ @LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@ @ep_extra_cxxflags@"
export OBJCFLAGS="@ep_objcflags@ @LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@ @ep_extra_objcflags@"
export LDFLAGS="@ep_ldflags@ @LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@ @ep_extra_ldflags@"
export PKG_CONFIG="@LINPHONE_BUILDER_PKG_CONFIG@"
export PKG_CONFIG_PATH="@LINPHONE_BUILDER_PKG_CONFIG_PATH@"
......
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