Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/ttssh2/ttxssh/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10267 - (show annotations) (download)
Wed Sep 14 14:15:56 2022 UTC (18 months, 3 weeks ago) by zmatsuo
File MIME type: text/plain
File size: 4831 byte(s)
cmakeビルド時、libresslライブラリ内の関数をコールするためのヘッダを追加

- r10261から arc4random() は libressl 内部の関数を使用するようになった
- 通常(cmakeではない)ビルド時、libs/libressl/include/compat/stdlib.h 参照する
- cmakeビルド時、このファイルを参照できないので libs/include に置くようにした
  - libressl を make install して生成された include/ には
    arc4random.c() のプロトタイプを含んだヘッダは入っていないため
1 set(PACKAGE_NAME "ttxssh")
2
3 option(TTXSSH_LIBRESSL "User LibreSSL" on)
4 option(TTXSSH_OPENSSL3 "Use OpenSSL3" off)
5
6 project(${PACKAGE_NAME})
7
8 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
9 if(TTXSSH_LIBRESSL)
10 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_libressl.cmake)
11 elseif(TTXSSH_OPENSSL3)
12 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl3.cmake)
13 else()
14 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
15 endif()
16
17 add_library(
18 ${PACKAGE_NAME} SHARED
19 )
20
21 target_sources(
22 ${PACKAGE_NAME}
23 PRIVATE
24 ../matcher/matcher.c
25 arc4random.c
26 arc4random.h
27 auth.c
28 auth.h
29 buffer.c
30 buffer.h
31 chacha.c
32 chacha.h
33 cipher-3des1.c
34 cipher-chachapoly-libcrypto.c
35 cipher-chachapoly.h
36 cipher-ctr.c
37 cipher.c
38 cipher.h
39 comp.c
40 comp.h
41 config.h
42 crypt.c
43 crypt.h
44 dns.c
45 dns.h
46 ed25519.c
47 ed25519_bcrypt_pbkdf.c
48 ed25519_blf.h
49 ed25519_blocks.c
50 ed25519_blowfish.c
51 ed25519_crypto_api.h
52 ed25519_fe25519.c
53 ed25519_fe25519.h
54 ed25519_ge25519.c
55 ed25519_ge25519.h
56 ed25519_hash.c
57 ed25519_sc25519.c
58 ed25519_sc25519.h
59 ed25519_verify.c
60 fwd-socks.c
61 fwd-socks.h
62 fwd.c
63 fwd.h
64 fwdui.c
65 fwdui.h
66 hostkey.c
67 hostkey.h
68 hosts.c
69 hosts.h
70 kex.c
71 kex.h
72 key.c
73 key.h
74 keyfiles.c
75 keyfiles.h
76 keyfiles-putty.c
77 keyfiles-putty.h
78 mac.c
79 mac.h
80 pkt.c
81 pkt.h
82 poly1305.c
83 poly1305.h
84 resource.h
85 sftp.c
86 sftp.h
87 ssh.c
88 ssh.h
89 ssherr.c
90 ssherr.h
91 ttxssh-version.h
92 ttxssh-version.rc
93 ttxssh.c
94 ttxssh.def
95 ttxssh.h
96 ttxssh.rc
97 util.c
98 util.h
99 x11util.c
100 x11util.h
101 ${COMMON_SRC}
102 )
103
104 target_sources(
105 ${PACKAGE_NAME}
106 PRIVATE
107 ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
108 ../../teraterm/common/ttcommon.h
109 ../../teraterm/common/i18n.h
110 ../../teraterm/common/ttlib.h
111 ../../teraterm/common/ttlib.c
112 ../../teraterm/common/dlglib.h
113 ../../teraterm/common/servicenames.h
114 ../../teraterm/common/codeconv.h
115 ../../teraterm/common/tipwin.h
116 ../../teraterm/common/compat_win.h
117 ../../teraterm/common/dllutil.h
118 )
119
120 source_group(
121 "common"
122 REGULAR_EXPRESSION
123 "teraterm\/common\/")
124
125 if(SUPPORT_OLD_WINDOWS)
126 if(MSVC)
127 if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
128 set(CMAKE_C_STANDARD_LIBRARIES "")
129 set(CMAKE_CXX_STANDARD_LIBRARIES "")
130 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
131 else()
132 target_link_options(
133 ${PACKAGE_NAME}
134 PRIVATE
135 /NODEFAULTLIB
136 )
137 endif()
138 target_sources(
139 ${PACKAGE_NAME}
140 PRIVATE
141 ../../teraterm/common/compat_w95_vs2005.c
142 )
143 endif()
144 if(MINGW)
145 target_sources(
146 ${PACKAGE_NAME}
147 PRIVATE
148 ../../teraterm/libmingw/tlssup.c
149 )
150 target_link_libraries(
151 ${PACKAGE_NAME}
152 PRIVATE
153 -Wl,--whole-archive
154 mingw_msvcrt
155 -Wl,--no-whole-archive
156 )
157 endif()
158 endif(SUPPORT_OLD_WINDOWS)
159
160 target_include_directories(
161 ${PACKAGE_NAME}
162 PRIVATE
163 ../../teraterm/teraterm
164 ../../teraterm/common
165 ../matcher
166 ../putty
167 ../../libs/include
168 ${ZLIB_INCLUDE_DIRS}
169 )
170
171 if(TTXSSH_LIBRESSL)
172 target_include_directories(
173 ${PACKAGE_NAME}
174 PRIVATE
175 ${LIBRESSL_INCLUDE_DIRS}
176 )
177 elseif(TTXSSH_OPENSSL3)
178 target_include_directories(
179 ${PACKAGE_NAME}
180 PRIVATE
181 ${OPENSSL3_INCLUDE_DIRS}
182 )
183 else()
184 target_include_directories(
185 ${PACKAGE_NAME}
186 PRIVATE
187 ${OPENSSL_INCLUDE_DIRS}
188 )
189 endif()
190
191
192 set_target_properties(
193 ${PACKAGE_NAME}
194 PROPERTIES
195 PREFIX ""
196 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
197 )
198
199 target_compile_definitions(
200 ${PACKAGE_NAME}
201 PRIVATE
202 $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
203 )
204
205 if(MINGW)
206 target_link_options(
207 ttxssh
208 PRIVATE
209 -Wl,-Map=ttxssh.map,-cref
210 )
211 endif()
212
213 target_link_libraries(
214 ${PACKAGE_NAME}
215 PRIVATE
216 common_static
217 libputty
218 ttpcmn
219 argon2
220 ${ZLIB_LIB}
221 )
222
223 if(TTXSSH_LIBRESSL)
224 target_link_libraries(
225 ${PACKAGE_NAME}
226 PRIVATE
227 ${LIBRESSL_LIB}
228 bcrypt.lib
229 )
230 elseif(TTXSSH_OPENSSL3)
231 target_link_libraries(
232 ${PACKAGE_NAME}
233 PRIVATE
234 ${OPENSSL3_LIB}
235 bcrypt.lib
236 )
237 else()
238 target_link_libraries(
239 ${PACKAGE_NAME}
240 PRIVATE
241 ${OPENSSL_LIB}
242 crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
243 )
244 endif()
245
246 if(SUPPORT_OLD_WINDOWS)
247 target_link_libraries(
248 ${PACKAGE_NAME}
249 PRIVATE
250 layer_for_unicode
251 )
252 endif()
253
254 target_link_libraries(
255 ${PACKAGE_NAME}
256 PRIVATE
257 ws2_32
258 gdi32
259 comdlg32
260 comctl32
261 )
262
263 install(
264 TARGETS ttxssh
265 RUNTIME
266 DESTINATION .
267 )

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26