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

Support build for Windows 10 with CMake.

parent d23ce6ed
......@@ -231,6 +231,9 @@ if(NOT MSVC)
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-fno-strict-aliasing")
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND STRICT_OPTIONS_CPP "/wd4996")
endif()
if(STRICT_OPTIONS_CPP)
list(REMOVE_DUPLICATES STRICT_OPTIONS_CPP)
endif()
......
......@@ -20,7 +20,7 @@
#
############################################################################
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
find_library(LIBGCC NAMES gcc)
find_library(LIBMINGWEX NAMES mingwex)
endif()
......@@ -165,10 +165,10 @@ endif()
if(ENABLE_TUNNEL)
list(APPEND LIBS ${TUNNEL_LIBRARIES})
endif()
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND LIBS ${LIBGCC} ${LIBMINGWEX})
endif()
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND LIBS shlwapi)
endif()
if(INTL_FOUND)
......@@ -195,7 +195,7 @@ if(IOS)
target_link_libraries(linphone "-framework Foundation" "-framework AVFoundation")
endif()
add_dependencies(linphone liblinphone-git-version)
if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_target_properties(linphone PROPERTIES PREFIX "lib")
endif()
if(ICONV_FOUND)
......
......@@ -50,11 +50,13 @@ set(SOURCE_FILES
apply_compile_flags(SOURCE_FILES "CPP" "C")
#executable must be available on root path, not host one
find_program(SIPP_PROGRAM NAMES sipp sipp.exe ONLY_CMAKE_FIND_ROOT_PATH)
if(SIPP_PROGRAM)
add_definitions(-DHAVE_SIPP=1)
add_definitions(-DSIPP_COMMAND="${SIPP_PROGRAM}")
if(NOT IOS OR NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Executable must be available on root path, not host one
find_program(SIPP_PROGRAM NAMES sipp sipp.exe ONLY_CMAKE_FIND_ROOT_PATH)
if(SIPP_PROGRAM)
add_definitions(-DHAVE_SIPP=1)
add_definitions(-DSIPP_COMMAND="${SIPP_PROGRAM}")
endif()
endif()
add_definitions(-DBC_CONFIG_FILE="config.h")
......@@ -73,6 +75,28 @@ if(IOS)
DESTINATION include/linphone
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(linphone_tester_static STATIC ${SOURCE_FILES})
target_include_directories(linphone_tester_static PUBLIC ${CUNIT_INCLUDE_DIRS} PRIVATE common)
target_link_libraries(linphone_tester_static linphone ${CUNIT_LIBRARIES})
set(RUNTIME_COMPONENT_SOURCES
liblinphone_tester_windows.cpp
liblinphone_tester_windows.h
)
add_library(linphone_tester_runtime MODULE ${RUNTIME_COMPONENT_SOURCES})
target_include_directories(linphone_tester_runtime PRIVATE common)
target_compile_options(linphone_tester_runtime PRIVATE "/wd4996")
target_link_libraries(linphone_tester_runtime linphone_tester_static)
set_target_properties(linphone_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE)
install(TARGETS linphone_tester_runtime
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/linphone_tester_runtime.winmd" DESTINATION bin)
else()
add_executable(liblinphone_tester ${SOURCE_FILES})
set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX)
......
......@@ -2,7 +2,7 @@
#include "liblinphone_tester_windows.h"
using namespace liblinphone_tester_runtime_component;
using namespace linphone_tester_runtime;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Storage;
......
......@@ -3,7 +3,7 @@
#include "linphonecore.h"
#include "liblinphone_tester.h"
namespace liblinphone_tester_runtime_component
namespace linphone_tester_runtime
{
public interface class OutputTraceListener
{
......
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