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

Fix extra flags passing to external projects.

parent 32e522f7
...@@ -340,6 +340,7 @@ endmacro() ...@@ -340,6 +340,7 @@ endmacro()
macro(linphone_builder_apply_flags) macro(linphone_builder_apply_flags)
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if(LINPHONE_BUILDER_OSX_ARCHITECTURES) if(LINPHONE_BUILDER_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES ${LINPHONE_BUILDER_OSX_ARCHITECTURES}) set(CMAKE_OSX_ARCHITECTURES ${LINPHONE_BUILDER_OSX_ARCHITECTURES})
set(AUTOTOOLS_ARCH "-arch ${CMAKE_OSX_ARCHITECTURES}") set(AUTOTOOLS_ARCH "-arch ${CMAKE_OSX_ARCHITECTURES}")
...@@ -350,29 +351,30 @@ macro(linphone_builder_apply_flags) ...@@ -350,29 +351,30 @@ macro(linphone_builder_apply_flags)
endif() endif()
if(LINPHONE_BUILDER_CPPFLAGS) if(LINPHONE_BUILDER_CPPFLAGS)
set(CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_CPPFLAGS}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${CMAKE_C_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_CPPFLAGS}")
set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_CPPFLAGS}") set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_CPPFLAGS}")
set(AUTOTOOLS_C_FLAGS "${AUTOTOOLS_C_FLAGS} ${LINPHONE_BUILDER_CPPFLAGS}") set(AUTOTOOLS_C_FLAGS "${AUTOTOOLS_C_FLAGS} ${LINPHONE_BUILDER_CPPFLAGS}")
set(AUTOTOOLS_CXX_FLAGS "${AUTOTOOLS_CXX_FLAGS} ${LINPHONE_BUILDER_CPPFLAGS}") set(AUTOTOOLS_CXX_FLAGS "${AUTOTOOLS_CXX_FLAGS} ${LINPHONE_BUILDER_CPPFLAGS}")
endif() endif()
if(LINPHONE_BUILDER_CFLAGS) if(LINPHONE_BUILDER_CFLAGS)
set(CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_CFLAGS}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${CMAKE_C_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_CFLAGS}")
set(AUTOTOOLS_C_FLAGS "${AUTOTOOLS_C_FLAGS} ${LINPHONE_BUILDER_CFLAGS}") set(AUTOTOOLS_C_FLAGS "${AUTOTOOLS_C_FLAGS} ${LINPHONE_BUILDER_CFLAGS}")
endif() endif()
if(LINPHONE_BUILDER_CXXFLAGS) if(LINPHONE_BUILDER_CXXFLAGS)
set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_CXXFLAGS}") set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_CXXFLAGS}")
set(AUTOTOOLS_CXX_FLAGS "{AUTOTOOLS_CXX_FLAGS} ${LINPHONE_BUILDER_CXX_FLAGS}") set(AUTOTOOLS_CXX_FLAGS "{AUTOTOOLS_CXX_FLAGS} ${LINPHONE_BUILDER_CXX_FLAGS}")
endif() endif()
if(LINPHONE_BUILDER_OBJCFLAGS) if(LINPHONE_BUILDER_OBJCFLAGS)
set(CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_OBJCFLAGS}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${CMAKE_C_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_OBJCFLAGS}")
set(AUTOTOOLS_OBJC_FLAGS "${AUTOTOOLS_OBJC_FLAGS} ${LINPHONE_BUILDER_OBJCFLAGS}") set(AUTOTOOLS_OBJC_FLAGS "${AUTOTOOLS_OBJC_FLAGS} ${LINPHONE_BUILDER_OBJCFLAGS}")
endif() endif()
if(LINPHONE_BUILDER_LDFLAGS) if(LINPHONE_BUILDER_LDFLAGS)
set(CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_LDFLAGS}") set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_LDFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_LDFLAGS}") set(CMAKE_MODULE_LINKER_FLAGS_${BUILD_TYPE} "${CMAKE_MODULE_LINKER_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_LDFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE}} ${LINPHONE_BUILDER_LDFLAGS}") set(CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE}} ${LINPHONE_BUILDER_LDFLAGS}")
set(AUTOTOOLS_LINKER_FLAGS "${AUTOTOOLS_LINKER_FLAGS} ${LINPHONE_BUILDER_LDFLAGS}") set(AUTOTOOLS_LINKER_FLAGS "${AUTOTOOLS_LINKER_FLAGS} ${LINPHONE_BUILDER_LDFLAGS}")
endif() endif()
unset(BUILD_TYPE)
endmacro() endmacro()
...@@ -389,12 +391,12 @@ endmacro() ...@@ -389,12 +391,12 @@ endmacro()
macro(linphone_builder_apply_extra_flags PROJNAME) macro(linphone_builder_apply_extra_flags PROJNAME)
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if(MSVC) if(MSVC)
set(_no_warnings_flag "/W0") set(_no_warnings_flag "/W0")
else() else()
set(_no_warnings_flag "-w") set(_no_warnings_flag "-w")
endif() endif()
if(EP_${PROJNAME}_BUILD_METHOD STREQUAL "autotools") if(EP_${PROJNAME}_BUILD_METHOD STREQUAL "autotools")
set(ep_asflags "${ep_asflags} ${EP_${PROJNAME}_EXTRA_ASFLAGS}") set(ep_asflags "${ep_asflags} ${EP_${PROJNAME}_EXTRA_ASFLAGS}")
set(ep_cppflags "${ep_cppflags} ${EP_${PROJNAME}_EXTRA_CPPFLAGS}") set(ep_cppflags "${ep_cppflags} ${EP_${PROJNAME}_EXTRA_CPPFLAGS}")
...@@ -406,36 +408,39 @@ macro(linphone_builder_apply_extra_flags PROJNAME) ...@@ -406,36 +408,39 @@ macro(linphone_builder_apply_extra_flags PROJNAME)
set(ep_cppflags "${ep_cppflags} ${_no_warnings_flag}") set(ep_cppflags "${ep_cppflags} ${_no_warnings_flag}")
endif() endif()
else() else()
set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS_${BUILD_TYPE}}")
set(SAVED_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(SAVED_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_${BUILD_TYPE}}")
set(SAVED_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") set(SAVED_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE}}")
set(SAVED_CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") set(SAVED_CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_${BUILD_TYPE}}")
set(SAVED_CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") set(SAVED_CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE}}")
if(EP_${PROJNAME}_EXTRA_CFLAGS) if(EP_${PROJNAME}_EXTRA_CFLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EP_${PROJNAME}_EXTRA_CFLAGS}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${CMAKE_C_FLAGS_${BUILD_TYPE}} ${EP_${PROJNAME}_EXTRA_CFLAGS}")
endif() endif()
if(EP_${PROJNAME}_EXTRA_CXXFLAGS) if(EP_${PROJNAME}_EXTRA_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EP_${PROJNAME}_EXTRA_CXXFLAGS}") set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${EP_${PROJNAME}_EXTRA_CXXFLAGS}")
endif() endif()
if(EP_${PROJNAME}_EXTRA_LDFLAGS) if(EP_${PROJNAME}_EXTRA_LDFLAGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(CMAKE_MODULE_LINKER_FLAGS_${BUILD_TYPE} "${CMAKE_MODULE_LINKER_FLAGS_${BUILD_TYPE}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
endif() endif()
if(EP_${PROJNAME}_IGNORE_WARNINGS) if(EP_${PROJNAME}_IGNORE_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_no_warnings_flag}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${CMAKE_C_FLAGS_${BUILD_TYPE}} ${_no_warnings_flag}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_no_warnings_flag}") set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${_no_warnings_flag}")
endif() endif()
endif() endif()
unset(BUILD_TYPE)
endmacro() endmacro()
macro(linphone_builder_restore_flags) macro(linphone_builder_restore_flags)
set(CMAKE_C_FLAGS "${SAVED_CMAKE_C_FLAGS}") string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${SAVED_CMAKE_EXE_LINKER_FLAGS}") set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_CXX_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${SAVED_CMAKE_MODULE_LINKER_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${SAVED_CMAKE_SHARED_LINKER_FLAGS}") set(CMAKE_MODULE_LINKER_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_SHARED_LINKER_FLAGS}")
unset(BUILD_TYPE)
endmacro() endmacro()
......
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