Commit 8ae96c1a authored by Ghislain MARY's avatar Ghislain MARY

Add support of build for Windows 10.

parent 4b3687ed
......@@ -71,8 +71,8 @@ else()
linphone_builder_apply_flags()
# Get build tools and flags for autotools projects (except for Windows Phone where we cannot build with MinGW)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
# Get build tools and flags for autotools projects (except for Windows Phone and Windows Store where we cannot build with MinGW)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
linphone_builder_get_autotools_configuration()
endif()
......
......@@ -175,6 +175,9 @@ else()
if(ENABLE_VIDEO AND (CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone"))
linphone_builder_add_builder_to_target(TARGET_ms2plugins mswp8vid)
endif()
if(ENABLE_VIDEO AND (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
linphone_builder_add_builder_to_target(TARGET_ms2plugins mswinrtvid)
endif()
endif()
......
......@@ -32,6 +32,9 @@ endif()
if(EP_ffmpeg_PREBUILT)
set(EP_ffmpeg_URL "${CMAKE_CURRENT_BINARY_DIR}/${EP_ffmpeg_FILENAME}")
set(EP_ffmpeg_BUILD_METHOD "prebuilt")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Use prebuilt library in the source tree for Windows 10
set(EP_ffmpeg_EXTERNAL_SOURCE_PATHS "build/ffmpeg")
else()
if(WIN32)
set(EP_ffmpeg_PATCH_OPTIONS "--binary")
......
......@@ -22,4 +22,5 @@
set(EP_matroska2_GIT_REPOSITORY "git://git.linphone.org/libmatroska-c.git" CACHE STRING "matroska2 repository URL")
set(EP_matroska2_GIT_TAG_LATEST "bc" CACHE STRING "matroska2 tag to use when compiling latest version")
set(EP_matroska2_GIT_TAG "97fed78cf55b05546bf13ae209843fa9cd704c8e" CACHE STRING "matroska2 tag to use")
set(EP_matroska2_GIT_TAG "b5254a96518b962a9738aa6c6f7dc28b5f312793" CACHE STRING "matroska2 tag to use")
set(EP_matroska2_EXTERNAL_SOURCE_PATHS "matroska")
############################################################################
# mswinrtvid.cmake
# Copyright (C) 2016 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(EP_mswinrtvid_GIT_REPOSITORY "git://git.linphone.org/mswinrtid.git" CACHE STRING "mswinrtvid repository URL")
set(EP_mswinrtvid_GIT_TAG_LATEST "master" CACHE STRING "mswinrtvid tag to use when compiling latest version")
set(EP_mswinrtvid_GIT_TAG "b067bca955dc170b54fffe019a6a7ce86c781c8a" CACHE STRING "mswinrtvid tag to use")
set(EP_mswinrtvid_EXTERNAL_SOURCE_PATHS "mswinrtvid")
set(EP_mswinrtvid_GROUPABLE YES)
set(EP_mswinrtvid_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mswinrtvid_DEPENDENCIES EP_ms2)
......@@ -35,7 +35,7 @@ if(EP_opencoreamr_PREBUILT)
else()
set(EP_opencoreamr_URL "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz")
set(EP_opencoreamr_URL_HASH "MD5=09d2c5dfb43a9f6e9fec8b1ae678e725")
set(EP_opencoreamr_EXTERNAL_SOURCE_PATHS "externals/opencore-amr")
set(EP_opencoreamr_EXTERNAL_SOURCE_PATHS "externals/opencore-amr" "opencore-amr")
set(EP_opencoreamr_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opencoreamr/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_opencoreamr_LINKING_TYPE "-DENABLE_STATIC=YES")
......
......@@ -20,56 +20,61 @@
#
############################################################################
find_program(NASM_PROGRAM
NAMES nasm nasm.exe
HINTS "${LINPHONE_BUILDER_WORK_DIR}/windows_tools"
)
if(NOT NASM_PROGRAM)
if(WIN32)
message(FATAL_ERROR "Could not find the nasm.exe program. Please install it from http://www.nasm.us/")
else()
message(FATAL_ERROR "Could not find the nasm program.")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Use prebuilt library in the source tree for Windows 10
set(EP_openh264_EXTERNAL_SOURCE_PATHS "build/openh264")
else()
find_program(NASM_PROGRAM
NAMES nasm nasm.exe
HINTS "${LINPHONE_BUILDER_WORK_DIR}/windows_tools"
)
if(NOT NASM_PROGRAM)
if(WIN32)
message(FATAL_ERROR "Could not find the nasm.exe program. Please install it from http://www.nasm.us/")
else()
message(FATAL_ERROR "Could not find the nasm program.")
endif()
endif()
endif()
set(EP_openh264_VERSION "1.5.0") # Keep this variable, it is used for packaging to know the version to download from Cisco
set(EP_openh264_GIT_REPOSITORY "https://github.com/cisco/openh264" CACHE STRING "openh264 repository URL")
set(EP_openh264_GIT_TAG "v${EP_openh264_VERSION}" CACHE STRING "openh264 tag to use")
set(EP_openh264_EXTERNAL_SOURCE_PATHS "externals/openh264")
set(EP_openh264_VERSION "1.5.0") # Keep this variable, it is used for packaging to know the version to download from Cisco
set(EP_openh264_GIT_REPOSITORY "https://github.com/cisco/openh264" CACHE STRING "openh264 repository URL")
set(EP_openh264_GIT_TAG "v${EP_openh264_VERSION}" CACHE STRING "openh264 tag to use")
set(EP_openh264_EXTERNAL_SOURCE_PATHS "externals/openh264")
set(EP_openh264_BUILD_METHOD "custom")
set(EP_openh264_LINKING_TYPE "-static")
set(EP_openh264_BUILD_TYPE "Release") # Always use Release build type, otherwise the codec is too slow...
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)
if (MSVC)
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"msvc\"")
endif()
if (APPLE)
if(IOS)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"arm64\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"armv7\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
set(EP_openh264_BUILD_METHOD "custom")
set(EP_openh264_LINKING_TYPE "-static")
set(EP_openh264_BUILD_TYPE "Release") # Always use Release build type, otherwise the codec is too slow...
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)
if (MSVC)
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"msvc\"")
endif()
if (APPLE)
if(IOS)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"arm64\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"armv7\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"i386\"")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"i386\"")
endif()
else()
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86\"")
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86\"")
endif()
endif()
endif()
endif()
......@@ -202,10 +202,12 @@ if(OPUS_ARM_EXTERNAL_ASM)
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/celt/arm/arm2gnu.pl" ${ARM2GNU_PARAMS} "<" "${CELT_SOURCES_ARM_ASM}" ">" "${CELT_SOURCES_EXTERNAL_ARM_ASM}")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/celt/arm/armopts.s.in ${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s @ONLY)
set(CELT_AM_SOURCES_ARM_ASM
${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s
)
if(OPUS_ARM_ASM)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/celt/arm/armopts.s.in ${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s @ONLY)
set(CELT_AM_SOURCES_ARM_ASM
${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s
)
endif()
if(OPUS_ARM_EXTERNAL_ASM)
set(CELT_AM_SOURCES_EXTERNAL_ARM_ASM
${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts-gnu.S
......@@ -376,8 +378,6 @@ if(ENABLE_FIXED_POINT)
list(APPEND SILK_SOURCES ${SILK_SOURCES_FIXED})
else()
list(APPEND SILK_SOURCES ${SILK_SOURCES_FLOAT})
endif()
if(ENABLE_FLOAT_API)
list(APPEND OPUS_SOURCES ${OPUS_SOURCES_FLOAT})
endif()
if(OPUS_ARM_ASM)
......@@ -386,6 +386,9 @@ if(OPUS_ARM_ASM)
list(APPEND CELT_SOURCES ${CELT_SOURCES_EXTERNAL_ARM_ASM} ${CELT_AM_SOURCES_EXTERNAL_ARM_ASM})
endif()
endif()
if(MSVC AND CMAKE_GENERATOR MATCHES "^.* ARM")
add_definitions(-DNO_INLINE_ASM)
endif()
if(ENABLE_STATIC)
......@@ -404,6 +407,9 @@ else()
endif()
target_compile_options(opus PRIVATE "-w")
target_compile_definitions(opus PRIVATE "-DHAVE_CONFIG_H")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_source_files_properties(src/opus_decoder.c PROPERTIES COMPILE_FLAGS "/wd4703")
endif()
install(TARGETS opus
RUNTIME DESTINATION bin
......
......@@ -32,7 +32,7 @@ if(WIN32)
list(APPEND SOURCE_FILES sqlite3.def)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_definitions(
-DSQLITE_OS_WINRT=1
-DSQLITE_WIN32_FILEMAPPING_API=1
......
......@@ -35,7 +35,7 @@ if(EP_voamrwbenc_PREBUILT)
else()
set(EP_voamrwbenc_URL "http://downloads.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz")
set(EP_voamrwbenc_URL_HASH "MD5=f63bb92bde0b1583cb3cb344c12922e0")
set(EP_voamrwbenc_EXTERNAL_SOURCE_PATHS "externals/vo-amrwbenc")
set(EP_voamrwbenc_EXTERNAL_SOURCE_PATHS "externals/vo-amrwbenc" "vo-amrwbenc")
set(EP_voamrwbenc_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/voamrwbenc/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_voamrwbenc_LINKING_TYPE "-DENABLE_STATIC=YES")
......
......@@ -32,6 +32,9 @@ endif()
if(EP_vpx_PREBUILT)
set(EP_vpx_URL "${CMAKE_CURRENT_BINARY_DIR}/${EP_vpx_FILENAME}")
set(EP_vpx_BUILD_METHOD "prebuilt")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Use prebuilt library in the source tree for Windows 10
set(EP_vpx_EXTERNAL_SOURCE_PATHS "build/libvpx")
else()
set(EP_vpx_URL "http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2")
set(EP_vpx_URL_HASH "MD5=49e59dd184caa255886683facea56fca")
......
......@@ -42,5 +42,7 @@ else()
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/config.h.cmake" "<SOURCE_DIR>")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/windowsphone_port.h" "<SOURCE_DIR>")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/universal_windows_port.h" "<SOURCE_DIR>")
endif()
endif()
......@@ -364,6 +364,8 @@ elseif(NOT APPLE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
target_compile_options(xml2 PRIVATE "/FIwindowsphone_port.h")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
target_compile_options(xml2 PRIVATE "/FIuniversal_windows_port.h")
endif()
install(TARGETS xml2
......
#ifndef LIBXML2_PORT_H
#define LIBXML2_PORT_H
#define GetVersionEx(osvi) (((osvi)->dwPlatformId = 0) != 0)
#define getcwd(a, b) NULL
#define getenv(x) NULL
#endif /* LIBXML2_PORT_H */
......@@ -102,6 +102,7 @@ list(APPEND LINPHONE_BUILDER_EP_VARS
CMAKE_MODULE_PATH:PATH
CMAKE_NO_BUILD_TYPE:BOOL
CMAKE_PREFIX_PATH:STRING
CMAKE_PROGRAM_PATH:STRING
CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING
......@@ -128,6 +129,13 @@ if(APPLE)
CMAKE_OSX_DEPLOYMENT_TARGET:STRING
)
endif()
if(MSVC)
if(CMAKE_VERSION VERSION_GREATER "3.3")
list(APPEND LINPHONE_BUILDER_EP_VARS
CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD:BOOL
)
endif()
endif()
if(CMAKE_TOOLCHAIN_FILE)
list(APPEND LINPHONE_BUILDER_EP_VARS CMAKE_TOOLCHAIN_FILE:PATH)
endif()
......
This diff is collapsed.
############################################################################
# config-windowsphone.cmake
# Copyright (C) 2015 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
# Define default values for the linphone builder options
set(DEFAULT_VALUE_ENABLE_DTLS ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_ILBC ON)
set(DEFAULT_VALUE_ENABLE_ISAC ON)
set(DEFAULT_VALUE_ENABLE_MKV ON)
set(DEFAULT_VALUE_ENABLE_OPUS ON)
set(DEFAULT_VALUE_ENABLE_SILK ON)
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
set(DEFAULT_VALUE_ENABLE_WEBRTC_AEC ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
# Global configuration
set(LINPHONE_BUILDER_CPPFLAGS "-D_ALLOW_KEYWORD_MACROS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS")
# Include builders
include(builders/CMakeLists.txt)
# linphone
list(APPEND EP_linphone_CMAKE_OPTIONS
"-DENABLE_RELATIVE_PREFIX=YES"
"-DENABLE_CONSOLE_UI=NO"
"-DENABLE_GTK_UI=NO"
"-DENABLE_NLS=NO"
"-DENABLE_NOTIFY=NO"
"-DENABLE_TOOLS=NO"
"-DENABLE_TUTORIALS=NO"
"-DENABLE_UPNP=NO"
)
# ms2
list(APPEND EP_ms2_CMAKE_OPTIONS
"-DENABLE_RELATIVE_PREFIX=YES"
"-DENABLE_TOOLS=NO"
)
# opus
list(APPEND EP_opus_CMAKE_OPTIONS
"-DENABLE_ASM=NO"
"-DENABLE_FIXED_POINT=YES"
)
set(EP_opus_LINKING_TYPE "-DENABLE_STATIC=YES")
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