Commit 32903610 authored by Ghislain MARY's avatar Ghislain MARY

Fix build of sqlite3 and xml2 for Windows Phone.

parent 5eab86bd
......@@ -32,6 +32,14 @@ if(WIN32)
list(APPEND SOURCE_FILES sqlite3.def)
endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
add_definitions(
-DSQLITE_OS_WINRT=1
-DSQLITE_WIN32_FILEMAPPING_API=1
-DSQLITE_OMIT_LOAD_EXTENSION
)
endif()
if(ENABLE_STATIC)
add_library(sqlite3 STATIC ${SOURCE_FILES})
else()
......
......@@ -35,7 +35,12 @@ if(EP_xml2_PREBUILT)
else()
set(EP_xml2_GIT_REPOSITORY "git://git.linphone.org/libxml2")
set(EP_xml2_GIT_TAG "v2.8.0")
set(EP_xml2_LINKING_TYPE "-DENABLE_STATIC=0")
set(EP_xml2_EXTERNAL_SOURCE_PATHS "libxml2" "xml2")
set(EP_xml2_LINKING_TYPE "-DENABLE_STATIC=NO")
set(EP_xml2_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_xml2_PATCH_COMMAND "${EP_xml2_PATCH_COMMAND}" "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/config.h.cmake" "<SOURCE_DIR>")
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>")
endif()
endif()
......@@ -358,6 +358,9 @@ if(MSVC)
elseif(NOT APPLE)
set_target_properties(xml2 PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
target_compile_options(xml2 PRIVATE "/FIwindowsphone_port.h")
endif()
install(TARGETS xml2
RUNTIME DESTINATION bin
......
#ifndef WINDOWSPHONE_PORT_H
#define WINDOWSPHONE_PORT_H
#define CreateMutex(a, b, c) CreateMutexExW(a, c, ((b) ? CREATE_MUTEX_INITIAL_OWNER : 0), 0)
#define GetVersionEx(osvi) (((osvi)->dwPlatformId = 0) != 0)
#define InitializeCriticalSection(cs) InitializeCriticalSectionEx(cs, 0, 0)
#define WaitForSingleObject(hHandle, dwMilliseconds) WaitForSingleObjectEx(hHandle, dwMilliseconds, 0)
#define Sleep(ms) { \
HANDLE sleepEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS); \
if (!sleepEvent) return; \
WaitForSingleObjectEx(sleepEvent, ms, FALSE); \
}
#endif /* WINDOWSPHONE_PORT_H */
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