Commit 2ac7557d authored by Ghislain MARY's avatar Ghislain MARY

Fix build of openh264 on Windows.

parent 2c7b59ef
......@@ -37,11 +37,6 @@ set(EP_openh264_BUILD_METHOD "custom")
set(EP_openh264_BUILD_IN_SOURCE "yes")
set(EP_openh264_LINKING_TYPE "-shared")
set(EP_openh264_BUILD_TYPE "Release") # Always use Release build type, otherwise the codec is too slow...
set(EP_openh264_CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_configure.sh)
set(EP_openh264_BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_build.sh)
set(EP_openh264_INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_install.sh)
linphone_builder_set_ep_directories(openh264)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/configure.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_configure.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/build.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_build.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_install.sh)
set(EP_openh264_CONFIGURE_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/configure.sh.cmake)
set(EP_openh264_BUILD_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/build.sh.cmake)
set(EP_openh264_INSTALL_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/install.sh.cmake)
......@@ -87,7 +87,7 @@ find_program(PKG_CONFIG_PROGRAM
)
if(NOT PKG_CONFIG_PROGRAM)
if(MINGW)
if(WIN32)
message(STATUS "Installing pkg-config to C:/MinGW/bin")
set(_pkg_config_dir ${CMAKE_CURRENT_BINARY_DIR}/pkg-config)
file(MAKE_DIRECTORY ${_pkg_config_dir})
......@@ -133,8 +133,8 @@ find_program(INTLTOOLIZE_PROGRAM
HINTS "C:/MinGW/msys/1.0/bin"
)
#if(NOT INTLTOOLIZE_PROGRAM)
if(MINGW)
if(NOT INTLTOOLIZE_PROGRAM)
if(WIN32)
message(STATUS "Installing intltoolize to C:/MinGW/bin")
set(_intltoolize_dir ${CMAKE_CURRENT_BINARY_DIR}/intltoolize)
file(MAKE_DIRECTORY ${_intltoolize_dir})
......@@ -164,7 +164,7 @@ find_program(INTLTOOLIZE_PROGRAM
NAMES intltoolize
HINTS "C:/MinGW/msys/1.0/bin"
)
#endif()
endif()
if(NOT INTLTOOLIZE_PROGRAM AND NOT MSVC)
message(FATAL_ERROR "Could not find the intltoolize program.")
......@@ -429,10 +429,22 @@ function(linphone_builder_add_project PROJNAME)
linphone_builder_expand_external_project_vars()
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "custom")
configure_file(${EP_${PROJNAME}_CONFIGURE_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh)
configure_file(${EP_${PROJNAME}_BUILD_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.sh)
configure_file(${EP_${PROJNAME}_INSTALL_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.sh)
if(WIN32)
set(SCRIPT_EXTENSION bat)
set(MSVC_PROJNAME ${PROJNAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mingw_configure.bat.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.bat)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mingw_build.bat.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.bat)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mingw_install.bat.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.bat)
else()
set(SCRIPT_EXTENSION sh)
endif()
set(BUILD_COMMANDS
CONFIGURE_COMMAND ${EP_${PROJNAME}_CONFIGURE_COMMAND}
BUILD_COMMAND ${EP_${PROJNAME}_BUILD_COMMAND}
INSTALL_COMMAND ${EP_${PROJNAME}_INSTALL_COMMAND}
CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.${SCRIPT_EXTENSION}
BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.${SCRIPT_EXTENSION}
INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.${SCRIPT_EXTENSION}
)
elseif("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools")
linphone_builder_create_autogen_command(${PROJNAME})
......
......@@ -97,11 +97,6 @@ list(APPEND EP_ms2_CONFIGURE_OPTIONS
# openh264
set(EP_openh264_LINKING_TYPE "-static")
# Force regeneration of cmake files so that linking type change is effective
linphone_builder_set_ep_directories(openh264)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/configure.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_configure.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/build.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_build.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_openh264_install.sh)
# opus
if(NOT MSVC)
......
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