Commit f76447b4 authored by Ghislain MARY's avatar Ghislain MARY

Allow build for Windows 10 with CMake.

parent d872144d
......@@ -213,10 +213,11 @@ if(WIN32)
-DBELLESIP_INTERNAL_EXPORTS
)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_definitions(
-DHAVE_COMPILER_TLS
-DUSE_FIXED_NAMESERVERS
-DUSE_GETADDRINFO_FALLBACK
)
endif()
......
......@@ -44,32 +44,59 @@ set(TESTER_SOURCES
add_definitions(-DBC_CONFIG_FILE="config.h")
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
apply_compile_flags(TESTER_SOURCES "CPP" "C")
add_executable(belle_sip_tester ${TESTER_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_include_directories(belle_sip_tester PUBLIC ${CUNIT_INCLUDE_DIR} PRIVATE common)
target_link_libraries(belle_sip_tester ${CUNIT_LIBRARIES} bellesip)
add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(OBJECT_DESCRIBE_SOURCES describe.c)
add_library(belle_sip_tester_static STATIC ${TESTER_SOURCES})
target_include_directories(belle_sip_tester_static PUBLIC ${CUNIT_INCLUDE_DIRS} PRIVATE common)
target_link_libraries(belle_sip_tester_static ${CUNIT_LIBRARIES} bellesip)
set(RUNTIME_COMPONENT_SOURCES
belle_sip_tester_windows.cpp
belle_sip_tester_windows.h
)
add_library(belle_sip_tester_runtime MODULE ${RUNTIME_COMPONENT_SOURCES})
target_include_directories(belle_sip_tester_runtime PRIVATE common)
target_link_libraries(belle_sip_tester_runtime belle_sip_tester_static)
set_target_properties(belle_sip_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE)
install(TARGETS belle_sip_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}/belle_sip_tester_runtime.winmd" DESTINATION bin)
else()
add_executable(belle_sip_tester ${TESTER_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_include_directories(belle_sip_tester PUBLIC ${CUNIT_INCLUDE_DIRS} PRIVATE common)
target_link_libraries(belle_sip_tester ${CUNIT_LIBRARIES} bellesip)
add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose)
set(OBJECT_DESCRIBE_SOURCES describe.c)
apply_compile_flags(OBJECT_DESCRIBE_SOURCES "CPP" "C")
add_executable(belle_sip_object_describe ${OBJECT_DESCRIBE_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_object_describe PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_link_libraries(belle_sip_object_describe bellesip)
apply_compile_flags(OBJECT_DESCRIBE_SOURCES "CPP" "C")
add_executable(belle_sip_object_describe ${OBJECT_DESCRIBE_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_object_describe PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_link_libraries(belle_sip_object_describe bellesip)
set(PARSE_SOURCES parse.c)
set(PARSE_SOURCES parse.c)
apply_compile_flags(PARSE_SOURCES "CPP" "C")
add_executable(belle_sip_parse ${PARSE_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_parse PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_link_libraries(belle_sip_parse bellesip)
apply_compile_flags(PARSE_SOURCES "CPP" "C")
add_executable(belle_sip_parse ${PARSE_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_parse PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_link_libraries(belle_sip_parse bellesip)
......@@ -2,7 +2,7 @@
#include "belle_sip_tester_windows.h"
using namespace belle_sip_tester_runtime_component;
using namespace belle_sip_tester_runtime;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Storage;
......
......@@ -3,7 +3,7 @@
#include "belle-sip/belle-sip.h"
#include "belle_sip_tester.h"
namespace belle_sip_tester_runtime_component
namespace belle_sip_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