From 9bea093a39b797a204e598189f9fae6f165550fb Mon Sep 17 00:00:00 2001 From: garethsb-sony Date: Thu, 9 Nov 2017 09:27:50 +0000 Subject: [PATCH 1/4] Patch to get e.g. "cpprest140d_2_10.dll" as described in Microsoft/cpprestsdk#577 --- Release/src/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt index be53a53305..927e98be0f 100644 --- a/Release/src/CMakeLists.txt +++ b/Release/src/CMakeLists.txt @@ -216,8 +216,18 @@ elseif(WINDOWS_STORE) endif() if(WIN32) - set_target_properties(cpprest PROPERTIES - OUTPUT_NAME "cpprest_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}") + string(SUBSTRING ${CMAKE_VS_PLATFORM_TOOLSET} 1 -1 TOOLSET) + set(CPPREST_VERSION_POSTFIX "_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}") + foreach(CFG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${CFG} CFG) + get_target_property(CFG_POSTFIX cpprest ${CFG}_POSTFIX) + if (NOT CFG_POSTFIX) + # forget "NOTFOUND" + set(CFG_POSTFIX) + endif() + set_target_properties(cpprest PROPERTIES + ${CFG}_POSTFIX "${TOOLSET}${CFG_POSTFIX}${CPPREST_VERSION_POSTFIX}") + endforeach() elseif(ANDROID) # Do not use SOVERSION on android. It is completely unsupported (and causes problems). # Perhaps revisit in the future? (NDK r9d, 8/7/14) From c7444407f66c47739af107bba63aafe133d1e945 Mon Sep 17 00:00:00 2001 From: garethsb-sony Date: Fri, 15 Dec 2017 11:14:35 +0000 Subject: [PATCH 2/4] Default the debug postfix for library filenames to "d" on Windows (it may still be overridden to the empty string) --- Release/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt index 218adcbb34..2b0e8d5f7b 100644 --- a/Release/CMakeLists.txt +++ b/Release/CMakeLists.txt @@ -32,6 +32,10 @@ else() set(BUILD_SAMPLES ON CACHE BOOL "Build sample applications.") endif() +if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Default filename postfix for libraries under configuration DEBUG") +endif() + if(ANDROID) set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Link against boost statically.") else() From 31ec7923b1eaf06567cea3bb7760f78ce44c447e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 3 Jan 2018 14:09:21 -0800 Subject: [PATCH 3/4] Extract the abi tag to make it more platform independent. --- Release/CMakeLists.txt | 20 ++++++++++++++++++-- Release/src/CMakeLists.txt | 17 +---------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt index 2b0e8d5f7b..416d5c1496 100644 --- a/Release/CMakeLists.txt +++ b/Release/CMakeLists.txt @@ -4,11 +4,15 @@ if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) # use MACOSX_RPATH endif() if(UNIX) - project(cpprest C CXX) + project(cpprestsdk C CXX) else() - project(cpprest CXX) + project(cpprestsdk CXX) endif() +set(CPPREST_VERSION_MAJOR 2) +set(CPPREST_VERSION_MINOR 10) +set(CPPREST_VERSION_REVISION 1) + enable_testing() set(WERROR ON CACHE BOOL "Treat Warnings as Errors.") @@ -34,6 +38,18 @@ endif() if(WIN32) set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Default filename postfix for libraries under configuration DEBUG") +else() + set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Default filename postfix for libraries under configuration DEBUG") +endif() + +if(WIN32) + set(TOOLSET) + if(CMAKE_VS_PLATFORM_TOOLSET) + string(REGEX REPLACE "^v" "" TOOLSET "${CMAKE_VS_PLATFORM_TOOLSET}") + endif() + set(CPPREST_ABI_TAG "${TOOLSET}_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}" CACHE STRING "Postfix tag for the cpprest abi") +else() + set(CPPREST_ABI_TAG "" CACHE STRING "Postfix tag for the cpprest abi") endif() if(ANDROID) diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt index 26dcc32ba3..a37a8cff9d 100644 --- a/Release/src/CMakeLists.txt +++ b/Release/src/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_policy(SET CMP0022 NEW) -set(CPPREST_VERSION_MAJOR 2) -set(CPPREST_VERSION_MINOR 10) -set(CPPREST_VERSION_REVISION 1) - file(GLOB HEADERS_CPPREST "../include/cpprest/*.h" "../include/cpprest/*.hpp" "../include/cpprest/*.dat") file(GLOB HEADERS_PPLX "../include/pplx/*.h" "../include/pplx/*.hpp") file(GLOB HEADERS_DETAILS "../include/cpprest/details/*.h" "../include/cpprest/details/*.hpp" "../include/cpprest/details/*.dat" "../include/pplx/*.hpp" "../include/pplx/*.dat") @@ -214,19 +210,8 @@ elseif(WINDOWS_STORE) endif() endif() +set_target_properties(cpprest PROPERTIES OUTPUT_NAME "cpprest${CPPREST_ABI_TAG}") if(WIN32) - string(SUBSTRING ${CMAKE_VS_PLATFORM_TOOLSET} 1 -1 TOOLSET) - set(CPPREST_VERSION_POSTFIX "_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}") - foreach(CFG ${CMAKE_CONFIGURATION_TYPES}) - string(TOUPPER ${CFG} CFG) - get_target_property(CFG_POSTFIX cpprest ${CFG}_POSTFIX) - if (NOT CFG_POSTFIX) - # forget "NOTFOUND" - set(CFG_POSTFIX) - endif() - set_target_properties(cpprest PROPERTIES - ${CFG}_POSTFIX "${TOOLSET}${CFG_POSTFIX}${CPPREST_VERSION_POSTFIX}") - endforeach() elseif(ANDROID) # Do not use SOVERSION on android. It is completely unsupported (and causes problems). # Perhaps revisit in the future? (NDK r9d, 8/7/14) From 17a198081379384ed9373828f905592ce9c4bdf3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 3 Jan 2018 14:09:36 -0800 Subject: [PATCH 4/4] Fix warning due to boost 1.66 --- Release/include/pplx/threadpool.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Release/include/pplx/threadpool.h b/Release/include/pplx/threadpool.h index c67db358a0..db1e97c870 100644 --- a/Release/include/pplx/threadpool.h +++ b/Release/include/pplx/threadpool.h @@ -67,9 +67,10 @@ class threadpool boost::asio::io_service& service() { return m_service; } protected: - threadpool(size_t num_threads) : m_service(num_threads) {} + threadpool(size_t num_threads) : m_service(static_cast(num_threads)) {} boost::asio::io_service m_service; }; } +