Skip to content

Commit d2acec6

Browse files
authored
Merge pull request #630 from garethsb-sony/dll-naming
Patch for Windows DLL naming
2 parents 66ba177 + 17a1980 commit d2acec6

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

Release/CMakeLists.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ if(POLICY CMP0042)
44
cmake_policy(SET CMP0042 NEW) # use MACOSX_RPATH
55
endif()
66
if(UNIX)
7-
project(cpprest C CXX)
7+
project(cpprestsdk C CXX)
88
else()
9-
project(cpprest CXX)
9+
project(cpprestsdk CXX)
1010
endif()
1111

12+
set(CPPREST_VERSION_MAJOR 2)
13+
set(CPPREST_VERSION_MINOR 10)
14+
set(CPPREST_VERSION_REVISION 1)
15+
1216
enable_testing()
1317

1418
set(WERROR ON CACHE BOOL "Treat Warnings as Errors.")
@@ -32,6 +36,22 @@ else()
3236
set(BUILD_SAMPLES ON CACHE BOOL "Build sample applications.")
3337
endif()
3438

39+
if(WIN32)
40+
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Default filename postfix for libraries under configuration DEBUG")
41+
else()
42+
set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Default filename postfix for libraries under configuration DEBUG")
43+
endif()
44+
45+
if(WIN32)
46+
set(TOOLSET)
47+
if(CMAKE_VS_PLATFORM_TOOLSET)
48+
string(REGEX REPLACE "^v" "" TOOLSET "${CMAKE_VS_PLATFORM_TOOLSET}")
49+
endif()
50+
set(CPPREST_ABI_TAG "${TOOLSET}_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}" CACHE STRING "Postfix tag for the cpprest abi")
51+
else()
52+
set(CPPREST_ABI_TAG "" CACHE STRING "Postfix tag for the cpprest abi")
53+
endif()
54+
3555
if(ANDROID)
3656
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Link against boost statically.")
3757
else()

Release/include/pplx/threadpool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ class threadpool
6767
boost::asio::io_service& service() { return m_service; }
6868

6969
protected:
70-
threadpool(size_t num_threads) : m_service(num_threads) {}
70+
threadpool(size_t num_threads) : m_service(static_cast<int>(num_threads)) {}
7171

7272
boost::asio::io_service m_service;
7373
};
7474

7575
}
76+

Release/src/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
cmake_policy(SET CMP0022 NEW)
22

3-
set(CPPREST_VERSION_MAJOR 2)
4-
set(CPPREST_VERSION_MINOR 10)
5-
set(CPPREST_VERSION_REVISION 1)
6-
73
file(GLOB HEADERS_CPPREST "../include/cpprest/*.h" "../include/cpprest/*.hpp" "../include/cpprest/*.dat")
84
file(GLOB HEADERS_PPLX "../include/pplx/*.h" "../include/pplx/*.hpp")
95
file(GLOB HEADERS_DETAILS "../include/cpprest/details/*.h" "../include/cpprest/details/*.hpp" "../include/cpprest/details/*.dat" "../include/pplx/*.hpp" "../include/pplx/*.dat")
@@ -214,9 +210,8 @@ elseif(WINDOWS_STORE)
214210
endif()
215211
endif()
216212

213+
set_target_properties(cpprest PROPERTIES OUTPUT_NAME "cpprest${CPPREST_ABI_TAG}")
217214
if(WIN32)
218-
set_target_properties(cpprest PROPERTIES
219-
OUTPUT_NAME "cpprest_${CPPREST_VERSION_MAJOR}_${CPPREST_VERSION_MINOR}")
220215
elseif(ANDROID)
221216
# Do not use SOVERSION on android. It is completely unsupported (and causes problems).
222217
# Perhaps revisit in the future? (NDK r9d, 8/7/14)

0 commit comments

Comments
 (0)