Commit b63a899f authored by DanmeiChen's avatar DanmeiChen

Fix/apply options for multi configuration generator

parent 73a6efb8
...@@ -176,4 +176,7 @@ else() ...@@ -176,4 +176,7 @@ else()
lcb_configure_options("--disable-avx512") lcb_configure_options("--disable-avx512")
endif() endif()
lcb_configure_env("CC=$CC_NO_LAUNCHER LD=$CC_NO_LAUNCHER ASFLAGS=$ASFLAGS CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS") lcb_configure_env("CC=$CC_NO_LAUNCHER LD=$CC_NO_LAUNCHER ASFLAGS=$ASFLAGS CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS")
# BUILD_ROOT is set by Xcode, but we still need the current build root.
# See https://gitlab.linphone.org/BC/public/external/libvpx/blob/v1.7.0-linphone/build/make/Makefile
lcb_make_options("BUILD_ROOT=.")
endif() endif()
...@@ -321,7 +321,18 @@ endmacro() ...@@ -321,7 +321,18 @@ endmacro()
macro(linphone_builder_apply_flags) macro(linphone_builder_apply_flags)
if (CMAKE_CONFIGURATION_TYPES)
FOREACH(CONFIG_NAME ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${CONFIG_NAME}" CONFIG_NAME_UPPER)
linphone_builder_apply_flags_for_build_type(${CONFIG_NAME_UPPER})
ENDFOREACH(CONFIG_NAME)
else()
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
linphone_builder_apply_flags_for_build_type(${BUILD_TYPE})
endif()
endmacro()
macro(linphone_builder_apply_flags_for_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}")
...@@ -378,7 +389,18 @@ endmacro() ...@@ -378,7 +389,18 @@ endmacro()
macro(linphone_builder_apply_extra_flags PROJNAME) macro(linphone_builder_apply_extra_flags PROJNAME)
if (CMAKE_CONFIGURATION_TYPES)
FOREACH(CONFIG_NAME ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${CONFIG_NAME}" CONFIG_NAME_UPPER)
linphone_builder_apply_extra_flags_for_build_type(${PROJNAME} ${CONFIG_NAME_UPPER})
ENDFOREACH(CONFIG_NAME)
else()
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
linphone_builder_apply_extra_flags_for_build_type(${PROJNAME} ${BUILD_TYPE})
endif()
endmacro()
macro(linphone_builder_apply_extra_flags_for_build_type PROJNAME BUILD_TYPE)
if(MSVC) if(MSVC)
set(_no_warnings_flag "/W0") set(_no_warnings_flag "/W0")
else() else()
...@@ -430,7 +452,18 @@ endmacro() ...@@ -430,7 +452,18 @@ endmacro()
macro(linphone_builder_restore_flags) macro(linphone_builder_restore_flags)
if (CMAKE_CONFIGURATION_TYPES)
FOREACH(CONFIG_NAME ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${CONFIG_NAME}" CONFIG_NAME_UPPER)
linphone_builder_restore_flags_for_build_type(${CONFIG_NAME_UPPER})
ENDFOREACH(CONFIG_NAME)
else()
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
linphone_builder_restore_flags_for_build_type(${BUILD_TYPE})
endif()
endmacro()
macro(linphone_builder_restore_flags_for_build_type BUILD_TYPE)
set(CMAKE_C_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_EXE_LINKER_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE} "${SAVED_CMAKE_EXE_LINKER_FLAGS}")
......
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