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 9323 - (show annotations) (download)
Tue Jun 29 15:20:06 2021 UTC (2 years, 9 months ago) by zmatsuo
File MIME type: text/plain
File size: 4382 byte(s)
cmakeビルド時dllの遅延ロードを行わない

- 使用しなくても動作するようになった
- delayimp のリンクをやめた
- Visual Studio /DELAYLOAD オプションを削除
1 set(PACKAGE_NAME "ttxssh")
2
3 project(${PACKAGE_NAME})
4
5 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
6 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
7
8 add_library(
9 ${PACKAGE_NAME} SHARED
10 )
11
12 target_sources(
13 ${PACKAGE_NAME}
14 PRIVATE
15 ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
16 ../matcher/matcher.c
17 arc4random.c
18 arc4random.h
19 auth.c
20 auth.h
21 buffer.c
22 buffer.h
23 chacha.c
24 chacha.h
25 cipher-3des1.c
26 cipher-chachapoly-libcrypto.c
27 cipher-chachapoly.h
28 cipher-ctr.c
29 cipher.c
30 cipher.h
31 comp.c
32 comp.h
33 config.h
34 crypt.c
35 crypt.h
36 dns.c
37 dns.h
38 ed25519.c
39 ed25519_bcrypt_pbkdf.c
40 ed25519_blf.h
41 ed25519_blocks.c
42 ed25519_blowfish.c
43 ed25519_crypto_api.h
44 ed25519_fe25519.c
45 ed25519_fe25519.h
46 ed25519_ge25519.c
47 ed25519_ge25519.h
48 ed25519_hash.c
49 ed25519_sc25519.c
50 ed25519_sc25519.h
51 ed25519_verify.c
52 fwd-socks.c
53 fwd-socks.h
54 fwd.c
55 fwd.h
56 fwdui.c
57 fwdui.h
58 hostkey.c
59 hostkey.h
60 hosts.c
61 hosts.h
62 kex.c
63 kex.h
64 key.c
65 key.h
66 keyfiles.c
67 keyfiles.h
68 keyfiles-putty.c
69 keyfiles-putty.h
70 mac.c
71 mac.h
72 pkt.c
73 pkt.h
74 poly1305.c
75 poly1305.h
76 resource.h
77 sftp.c
78 sftp.h
79 ssh.c
80 ssh.h
81 ssherr.c
82 ssherr.h
83 ttxssh-version.h
84 ttxssh-version.rc
85 ttxssh.c
86 ttxssh.def
87 ttxssh.h
88 ttxssh.rc
89 util.c
90 util.h
91 x11util.c
92 x11util.h
93 ${COMMON_SRC}
94 )
95
96 target_sources(
97 ${PACKAGE_NAME}
98 PRIVATE
99 ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
100 ../../teraterm/common/ttcommon.h
101 ../../teraterm/common/i18n.h
102 ../../teraterm/common/ttlib.h
103 ../../teraterm/common/ttlib.c
104 ../../teraterm/common/dlglib.h
105 ../../teraterm/common/servicenames.h
106 ../../teraterm/common/codeconv.h
107 ../../teraterm/common/tipwin.h
108 ../../teraterm/common/layer_for_unicode.h
109 ../../teraterm/common/compat_win.h
110 ../../teraterm/common/dllutil.h
111 )
112
113 source_group(
114 "common"
115 REGULAR_EXPRESSION
116 "teraterm\/common\/")
117
118 if(SUPPORT_OLD_WINDOWS)
119 if(MSVC)
120 target_sources(
121 ${PACKAGE_NAME}
122 PRIVATE
123 ../../teraterm/common/compat_w95_vs2005.c
124 )
125 endif()
126 if(MINGW)
127 target_sources(
128 ${PACKAGE_NAME}
129 PRIVATE
130 ../../teraterm/libmingw/tlssup.c
131 )
132 target_link_libraries(
133 ${PACKAGE_NAME}
134 PRIVATE
135 -Wl,--whole-archive
136 mingw_msvcrt
137 -Wl,--no-whole-archive
138 )
139 endif()
140 endif(SUPPORT_OLD_WINDOWS)
141
142 target_include_directories(
143 ${PACKAGE_NAME}
144 PRIVATE
145 ../../teraterm/teraterm
146 ../../teraterm/common
147 ../matcher
148 ../putty
149 ${OPENSSL_INCLUDE_DIRS}
150 ${ZLIB_INCLUDE_DIRS}
151 )
152
153 set_target_properties(
154 ${PACKAGE_NAME}
155 PROPERTIES
156 PREFIX ""
157 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
158 )
159
160 target_compile_definitions(
161 ${PACKAGE_NAME}
162 PRIVATE
163 $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
164 )
165
166 if(MINGW)
167 target_link_options(
168 ttxssh
169 PRIVATE
170 -Wl,-Map=ttxssh.map,-cref
171 )
172 endif()
173
174 target_link_libraries(
175 ${PACKAGE_NAME}
176 PRIVATE
177 common_static
178 libputty
179 ttpcmn
180 argon2
181 ${ZLIB_LIB}
182 ${OPENSSL_LIB}
183 #
184 ws2_32
185 gdi32
186 comdlg32
187 comctl32
188 # OpenSSL が使用
189 crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
190 )
191
192 ### create puttyversion.h
193
194 set(PUTTY_ISS "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss")
195 if(NOT EXISTS ${PUTTY_ISS})
196 message(FATAL_ERROR "${PUTTY_ISS} not found")
197 endif()
198
199 file(READ "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss" iis)
200
201 string(REGEX MATCH "VersionInfoTextVersion=([^\n]+)\n" _ ${iis})
202 set(version_str ${CMAKE_MATCH_1})
203 if("${version_str}" STREQUAL "")
204 string(REGEX MATCH "AppVerName=([^\n]+)\n" _ ${iis})
205 set(version_str ${CMAKE_MATCH_1})
206 endif()
207 if("${version_str}" STREQUAL "")
208 set(version_str "unknown")
209 endif()
210 message("putty version=\"${version_str}\"")
211 FILE(
212 WRITE ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
213 "#define PUTTYVERSION \"${version_str}\"\n"
214 )
215
216 install(
217 TARGETS ttxssh
218 RUNTIME
219 DESTINATION .
220 )
221
222 ####
223 # ソースツリー内に生成ファイルが存在していたら削除する
224 if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
225 file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
226 endif()

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