diff options
Diffstat (limited to '')
-rw-r--r-- | ssl/CMakeLists.txt | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index e2eeab5..637e0f0 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt | |||
@@ -1,3 +1,18 @@ | |||
1 | # | ||
2 | # Copyright (c) 2014 Brent Cook | ||
3 | # | ||
4 | # Permission to use, copy, modify, and distribute this software for any | ||
5 | # purpose with or without fee is hereby granted, provided that the above | ||
6 | # copyright notice and this permission notice appear in all copies. | ||
7 | # | ||
8 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | |||
1 | set( | 16 | set( |
2 | SSL_SRC | 17 | SSL_SRC |
3 | bio_ssl.c | 18 | bio_ssl.c |
@@ -72,6 +87,13 @@ target_include_directories(ssl_obj | |||
72 | ../include | 87 | ../include |
73 | ${CMAKE_BINARY_DIR}/include) | 88 | ${CMAKE_BINARY_DIR}/include) |
74 | 89 | ||
90 | if(MSVC) | ||
91 | # "C4702" - unreachable code | ||
92 | set_source_files_properties(d1_pkt.c s3_cbc.c PROPERTIES | ||
93 | COMPILE_OPTIONS /wd4702 | ||
94 | ) | ||
95 | endif() | ||
96 | |||
75 | add_library(bs_obj OBJECT ${BS_SRC}) | 97 | add_library(bs_obj OBJECT ${BS_SRC}) |
76 | target_include_directories(bs_obj | 98 | target_include_directories(bs_obj |
77 | PRIVATE | 99 | PRIVATE |
@@ -86,16 +108,16 @@ endif() | |||
86 | 108 | ||
87 | export_symbol(ssl ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym) | 109 | export_symbol(ssl ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym) |
88 | target_link_libraries(ssl crypto ${PLATFORM_LIBS}) | 110 | target_link_libraries(ssl crypto ${PLATFORM_LIBS}) |
89 | if (WIN32) | ||
90 | set(SSL_POSTFIX -${SSL_MAJOR_VERSION} PARENT_SCOPE) | ||
91 | endif() | ||
92 | set_target_properties(ssl PROPERTIES | 111 | set_target_properties(ssl PROPERTIES |
93 | OUTPUT_NAME ssl${SSL_POSTFIX} | 112 | OUTPUT_NAME ssl |
94 | ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX} | 113 | ARCHIVE_OUTPUT_NAME ssl |
95 | EXPORT_NAME SSL | 114 | EXPORT_NAME SSL |
96 | VERSION ${SSL_VERSION} | 115 | VERSION ${SSL_VERSION} |
97 | SOVERSION ${SSL_MAJOR_VERSION} | 116 | SOVERSION ${SSL_MAJOR_VERSION} |
98 | ) | 117 | ) |
118 | if(NOT CMAKE_VERSION VERSION_LESS 3.27.0) | ||
119 | set_target_properties(ssl PROPERTIES DLL_NAME_WITH_SOVERSION TRUE) | ||
120 | endif() | ||
99 | 121 | ||
100 | target_include_directories( | 122 | target_include_directories( |
101 | ssl | 123 | ssl |
@@ -104,6 +126,30 @@ target_include_directories( | |||
104 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | 126 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> |
105 | ) | 127 | ) |
106 | 128 | ||
129 | if(HOST_AARCH64) | ||
130 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/aarch64/) | ||
131 | elseif(HOST_ARM) | ||
132 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/arm/) | ||
133 | elseif(HOST_I386) | ||
134 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/i386/) | ||
135 | elseif(HOST_LOONGARCH64) | ||
136 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/loongarch64) | ||
137 | elseif(HOST_MIPS64) | ||
138 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/mips64) | ||
139 | elseif(HOST_MIPS) | ||
140 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/mips) | ||
141 | elseif(HOST_POWERPC) | ||
142 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/powerpc) | ||
143 | elseif(HOST_POWERPC64) | ||
144 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/powerpc64) | ||
145 | elseif(HOST_RISCV64) | ||
146 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/riscv64) | ||
147 | elseif(HOST_SPARC64) | ||
148 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/sparc64) | ||
149 | elseif(HOST_X86_64) | ||
150 | target_include_directories(ssl_obj PRIVATE ../crypto/arch/amd64) | ||
151 | endif() | ||
152 | |||
107 | install( | 153 | install( |
108 | TARGETS ssl | 154 | TARGETS ssl |
109 | EXPORT SSL-target | 155 | EXPORT SSL-target |
@@ -135,4 +181,3 @@ if(BUILD_SHARED_LIBS) | |||
135 | add_library(ssl-static STATIC $<TARGET_OBJECTS:ssl_obj>) | 181 | add_library(ssl-static STATIC $<TARGET_OBJECTS:ssl_obj>) |
136 | target_link_libraries(ssl-static crypto-static ${PLATFORM_LIBS}) | 182 | target_link_libraries(ssl-static crypto-static ${PLATFORM_LIBS}) |
137 | endif() | 183 | endif() |
138 | |||