Skip to content

Commit 28919d0

Browse files
committed
Fix issue CMake building for UWP
1 parent 71332b5 commit 28919d0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Release/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ elseif(UNIX AND NOT APPLE) # Note: also android
6969
set(CPPREST_HTTP_CLIENT_IMPL asio CACHE STRING "Internal use.")
7070
set(CPPREST_HTTP_LISTENER_IMPL asio CACHE STRING "Internal use.")
7171
elseif(WINDOWS_PHONE OR WINDOWS_STORE)
72-
set(CPPREST_PPLX_IMPL win CACHE STRING "Internal use.")
72+
set(CPPREST_PPLX_IMPL winrt CACHE STRING "Internal use.")
7373
set(CPPREST_WEBSOCKETS_IMPL winrt CACHE STRING "Internal use.")
7474
set(CPPREST_FILEIO_IMPL winrt CACHE STRING "Internal use.")
7575
set(CPPREST_HTTP_CLIENT_IMPL winrt CACHE STRING "Internal use.")
@@ -115,7 +115,12 @@ elseif(ANDROID)
115115
)
116116
elseif(UNIX) # This includes OSX
117117
elseif(WIN32)
118-
add_definitions(-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0600 -DWIN32 -D_SCL_SECURE_NO_WARNINGS)
118+
add_definitions(-DUNICODE -D_UNICODE -DWIN32 -D_SCL_SECURE_NO_WARNINGS)
119+
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
120+
add_definitions(-D_WIN32_WINNT=0x0A00)
121+
else()
122+
add_definitions(-D_WIN32_WINNT=0x0600)
123+
endif()
119124

120125
if(NOT BUILD_SHARED_LIBS)
121126
# This causes cmake to not link the test libraries separately, but instead hold onto their object files.

Release/src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ elseif(CPPREST_PPLX_IMPL STREQUAL "winpplx")
8080
pplx/threadpool.cpp
8181
pplx/pplxwin.cpp
8282
)
83+
elseif(CPPREST_PPLX_IMPL STREQUAL "winrt")
84+
list(APPEND SOURCES
85+
pplx/pplxwin.cpp
86+
)
87+
list(FILTER HEADERS_PPLX EXCLUDE REGEX "threadpool\\.h")
8388
endif()
8489

8590
# Http client component
@@ -186,6 +191,7 @@ if(CPPREST_PPLX_IMPL STREQUAL "apple")
186191
target_link_libraries(cpprest PRIVATE ${COREFOUNDATION} ${SECURITY})
187192
elseif(CPPREST_PPLX_IMPL STREQUAL "linux")
188193
elseif(CPPREST_PPLX_IMPL STREQUAL "win")
194+
elseif(CPPREST_PPLX_IMPL STREQUAL "winrt")
189195
elseif(CPPREST_PPLX_IMPL STREQUAL "winpplx")
190196
target_compile_definitions(cpprest PUBLIC -DCPPREST_FORCE_PPLX=1)
191197
else()

0 commit comments

Comments
 (0)