diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2018-10-05 22:59:44 +0900 |
---|---|---|
committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2018-10-05 22:59:44 +0900 |
commit | 0b8343ace3a854fcb2d7bed850847db54841d6cf (patch) | |
tree | ad401ecf9878a28af13eb3d1cecc442d009a5263 /CMakeLists.txt | |
parent | f819a2bce7a708147df16b5bef21ccaadf7b9913 (diff) | |
download | portable-0b8343ace3a854fcb2d7bed850847db54841d6cf.tar.gz portable-0b8343ace3a854fcb2d7bed850847db54841d6cf.tar.bz2 portable-0b8343ace3a854fcb2d7bed850847db54841d6cf.zip |
Fix cmake to generate proper Libs.private in .pc files
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 27cd8da..8fde8cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -55,7 +55,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") | |||
55 | add_definitions(-D_BSD_SOURCE) | 55 | add_definitions(-D_BSD_SOURCE) |
56 | add_definitions(-D_POSIX_SOURCE) | 56 | add_definitions(-D_POSIX_SOURCE) |
57 | add_definitions(-D_GNU_SOURCE) | 57 | add_definitions(-D_GNU_SOURCE) |
58 | set(PLATFORM_LDADD ${PLATFORM_LDADD} pthread) | 58 | set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) |
59 | endif() | 59 | endif() |
60 | 60 | ||
61 | if(CMAKE_SYSTEM_NAME MATCHES "MINGW") | 61 | if(CMAKE_SYSTEM_NAME MATCHES "MINGW") |
@@ -74,7 +74,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") | |||
74 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off") | 74 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off") |
75 | endif() | 75 | endif() |
76 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") | 76 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") |
77 | set(PLATFORM_LDADD ${PLATFORM_LDADD} pthread) | 77 | set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) |
78 | endif() | 78 | endif() |
79 | 79 | ||
80 | if(CMAKE_SYSTEM_NAME MATCHES "SunOS") | 80 | if(CMAKE_SYSTEM_NAME MATCHES "SunOS") |
@@ -83,7 +83,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "SunOS") | |||
83 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600") | 83 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600") |
84 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP") | 84 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP") |
85 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic") | 85 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic") |
86 | set(PLATFORM_LDADD ${PLATFORM_LDADD} nsl socket) | 86 | set(PLATFORM_LIBS ${PLATFORM_LIBS} nsl socket) |
87 | endif() | 87 | endif() |
88 | 88 | ||
89 | add_definitions(-DLIBRESSL_INTERNAL) | 89 | add_definitions(-DLIBRESSL_INTERNAL) |
@@ -104,7 +104,7 @@ if(WIN32) | |||
104 | add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS) | 104 | add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS) |
105 | add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600) | 105 | add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600) |
106 | add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT) | 106 | add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT) |
107 | set(PLATFORM_LDADD ${PLATFORM_LDADD} ws2_32) | 107 | set(PLATFORM_LIBS ${PLATFORM_LIBS} ws2_32) |
108 | endif() | 108 | endif() |
109 | 109 | ||
110 | if(MSVC) | 110 | if(MSVC) |
@@ -270,7 +270,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") | |||
270 | # Check if we need -lrt to get clock_gettime on Linux | 270 | # Check if we need -lrt to get clock_gettime on Linux |
271 | check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) | 271 | check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) |
272 | if (HAVE_CLOCK_GETTIME) | 272 | if (HAVE_CLOCK_GETTIME) |
273 | set(PLATFORM_LDADD ${PLATFORM_LDADD} rt) | 273 | set(PLATFORM_LIBS ${PLATFORM_LIBS} rt) |
274 | endif() | 274 | endif() |
275 | else() | 275 | else() |
276 | # Otherwise, simply check if it exists | 276 | # Otherwise, simply check if it exists |
@@ -289,7 +289,7 @@ if(SIZEOF_TIME_T STREQUAL "4") | |||
289 | endif() | 289 | endif() |
290 | add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) | 290 | add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) |
291 | 291 | ||
292 | set(OPENSSL_LIBS tls ssl crypto ${PLATFORM_LDADD}) | 292 | set(OPENSSL_LIBS tls ssl crypto ${PLATFORM_LIBS}) |
293 | 293 | ||
294 | add_subdirectory(crypto) | 294 | add_subdirectory(crypto) |
295 | add_subdirectory(ssl) | 295 | add_subdirectory(ssl) |
@@ -312,6 +312,7 @@ if(NOT MSVC) | |||
312 | set(exec_prefix \${prefix}) | 312 | set(exec_prefix \${prefix}) |
313 | set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) | 313 | set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) |
314 | set(includedir \${prefix}/include) | 314 | set(includedir \${prefix}/include) |
315 | string(REGEX REPLACE ";" " -l" PLATFORM_LDADD ";${PLATFORM_LIBS}") | ||
315 | file(STRINGS "VERSION" VERSION LIMIT_COUNT 1) | 316 | file(STRINGS "VERSION" VERSION LIMIT_COUNT 1) |
316 | file(GLOB OPENSSL_PKGCONFIGS "*.pc.in") | 317 | file(GLOB OPENSSL_PKGCONFIGS "*.pc.in") |
317 | foreach(file ${OPENSSL_PKGCONFIGS}) | 318 | foreach(file ${OPENSSL_PKGCONFIGS}) |