Skip to content

Commit

Permalink
Merge pull request #630 from garethsb-sony/dll-naming
Browse files Browse the repository at this point in the history
Patch for Windows DLL naming
  • Loading branch information
ras0219-msft authored Jan 9, 2018
2 parents 66ba177 + 17a1980 commit d2acec6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
24 changes: 22 additions & 2 deletions Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -32,6 +36,22 @@ 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")
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)
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Link against boost statically.")
else()
Expand Down
3 changes: 2 additions & 1 deletion Release/include/pplx/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(num_threads)) {}

boost::asio::io_service m_service;
};

}

7 changes: 1 addition & 6 deletions Release/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -214,9 +210,8 @@ elseif(WINDOWS_STORE)
endif()
endif()

set_target_properties(cpprest PROPERTIES OUTPUT_NAME "cpprest${CPPREST_ABI_TAG}")
if(WIN32)
set_target_properties(cpprest PROPERTIES
OUTPUT_NAME "cpprest_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}")
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)
Expand Down

0 comments on commit d2acec6

Please sign in to comment.