Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
363168a
add option to directly support narrow strings on win32
jason-ha Jul 10, 2019
3574455
refactor strings_utils from asyncrt_utils
jason-ha Jul 19, 2019
be44557
temp rename asyncrt_utils for split preserving history
jason-ha Jul 19, 2019
76e9ad1
merge for asyncrt_utils split
jason-ha Jul 19, 2019
926f431
refactor memory_utils from asyncrt_utils
jason-ha Jul 19, 2019
dec33c5
merge for asyncrt_utils split
jason-ha Jul 19, 2019
2479267
breakout pieces of asyncrt_utils enabling custom building of select c…
jason-ha Jul 19, 2019
f4f3f94
add <memory> includes in header with explicit dependencies
jason-ha Jul 23, 2019
665e00e
add <typeinfo> include for bad_cast in string_utils.h
jason-ha Jul 23, 2019
df2bbe9
add <algorithm> for std::count in nonce_generator_tests.cpp
jason-ha Jul 23, 2019
d2ad866
nudge pipeline to rerun
jason-ha Jul 23, 2019
1a29dba
On isolated_components: Add option to build components in isolated li…
jason-ha Jul 23, 2019
d2479ea
fix yaml indent
jason-ha Jul 23, 2019
734a1f1
fix build breaks
jason-ha Jul 24, 2019
052890e
isolated component build fixes per Ubuntu
jason-ha Jul 24, 2019
beaa358
compile isolated components with -fPIC
jason-ha Jul 24, 2019
164309d
include boost/asio/ssl.hpp that fileio_posix.cpp used to get from std…
jason-ha Jul 24, 2019
690b36f
more includes per isolated Ubuntu build
jason-ha Jul 25, 2019
3caf23d
last of memcpy updates for isolated components
jason-ha Jul 25, 2019
5bd4d98
fix yaml for Ubuntu test step breakup
jason-ha Jul 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Intermediate/
# Ignore cmake building directories
build.*/
docs/
out/
# Ignore NuGet artifacts
.nuget/
Build_android/build/
Expand Down
33 changes: 31 additions & 2 deletions Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ set(CPPREST_EXCLUDE_WEBSOCKETS OFF CACHE BOOL "Exclude websockets functionality.
set(CPPREST_EXCLUDE_COMPRESSION OFF CACHE BOOL "Exclude compression functionality.")
set(CPPREST_EXCLUDE_BROTLI ON CACHE BOOL "Exclude Brotli compression functionality.")
set(CPPREST_EXPORT_DIR cpprestsdk CACHE STRING "Directory to install CMake config files.")
option(CPPREST_FORCE_NARROW_STRINGS "Keep strings narrow/UTF8 (even if WIN32)" OFF)
set(CPPREST_INSTALL_HEADERS ON CACHE BOOL "Install header files.")
set(CPPREST_INSTALL ON CACHE BOOL "Add install commands.")
option(CPPREST_ISOLATE_COMPONENTS "Build cpprest components as individual libraries" OFF)

if(IOS OR ANDROID)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries")
Expand Down Expand Up @@ -112,9 +114,31 @@ else()
message(FATAL_ERROR "Unknown platform. Cannot determine appropriate feature implementations.")
endif()

# CPPREST_EXCLUDE_HTTP_NARROW_STRING_WIP is not a formal option. It exists to
# allow a successfull Windows build with CPPREST_FORCE_NARROW_STRINGS enabled
# until HTTP related code can be updated with support.
set(CPPREST_EXCLUDE_HTTP_NARROW_STRING_WIP OFF)
if(CPPREST_FORCE_NARROW_STRINGS AND WIN32)
if(NOT CPPREST_EXCLUDE_WEBSOCKETS)
message(FATAL_ERROR "CPPREST_EXCLUDE_WEBSOCKETS must be OFF when forcing narrow strings on Windows (WIP)")
endif()
if(NOT CPPREST_HTTP_LISTENER_IMPL STREQUAL "none")
message(FATAL_ERROR "CPPREST_HTTP_LISTENER_IMPL must be 'none' when forcing narrow strings on Windows (per http_server_httpsys.cpp WIP)")
endif()
set(CPPREST_EXCLUDE_HTTP_NARROW_STRING_WIP ON)
if(BUILD_SAMPLES)
message(WARNING "Most samples will fail build when forcing narrow strings on Windows (WIP)")
endif()
endif()

set(WARNINGS)
set(ANDROID_LIBS)

# Generic build settings
if(CPPREST_FORCE_NARROW_STRINGS)
add_definitions(-DCPPREST_FORCE_NARROW_STRINGS)
endif()

# Platform (not compiler) specific settings
if(ANDROID)
# These are used in the shared library case
Expand Down Expand Up @@ -212,7 +236,8 @@ if(NOT PARENT_DIR STREQUAL "")
endif()

# Finally, the tests all use the same style declaration to build themselves, so we use a function
function(add_casablanca_test NAME SOURCES_VAR)
# Tests that don't specify IMPLEMENTATION_TARGETS are assumed to depend on whole of cpprest.
function(add_casablanca_test NAME SOURCES_VAR) # [optional] IMPLEMENTATION_TARGETS...
add_library(${NAME} ${TEST_LIBRARY_TARGET_TYPE} ${${SOURCES_VAR}})
message("-- Added test library ${NAME}")
if(TEST_LIBRARY_TARGET_TYPE STREQUAL "OBJECT")
Expand All @@ -221,8 +246,12 @@ function(add_casablanca_test NAME SOURCES_VAR)
target_compile_definitions(${NAME} PRIVATE $<TARGET_PROPERTY:${_dep},INTERFACE_COMPILE_DEFINITIONS>)
endforeach()
else()
set(IMPLEMENTATION_TARGETS cpprest)
if(CPPREST_ISOLATE_COMPONENTS AND ${ARGC} GREATER 2)
set(IMPLEMENTATION_TARGETS ${ARGN})
endif()
target_link_libraries(${NAME} PRIVATE
cpprest
${IMPLEMENTATION_TARGETS}
common_utilities
unittestpp
${ANDROID_LIBS}
Expand Down
Loading