Develop and Download Open Source Software

Browse Subversion Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9323 - (hide 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 zmatsuo 9129 set(PACKAGE_NAME "ttxssh")
2 zmatsuo 7456
3 zmatsuo 9129 project(${PACKAGE_NAME})
4 zmatsuo 7456
5     include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
6     include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
7    
8 zmatsuo 7952 add_library(
9 zmatsuo 9129 ${PACKAGE_NAME} SHARED
10 zmatsuo 7456 )
11    
12 zmatsuo 7952 target_sources(
13 zmatsuo 9129 ${PACKAGE_NAME}
14 zmatsuo 7952 PRIVATE
15 zmatsuo 7456 ${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 nmaya 9255 cipher-3des1.c
26     cipher-chachapoly-libcrypto.c
27     cipher-chachapoly.h
28     cipher-ctr.c
29     cipher.c
30 zmatsuo 7456 cipher.h
31 nmaya 9255 comp.c
32     comp.h
33 zmatsuo 7456 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 nmaya 9255 fwd-socks.c
53     fwd-socks.h
54 zmatsuo 7456 fwd.c
55     fwd.h
56     fwdui.c
57     fwdui.h
58 nmaya 9255 hostkey.c
59     hostkey.h
60 zmatsuo 7456 hosts.c
61     hosts.h
62     kex.c
63     kex.h
64     key.c
65     key.h
66     keyfiles.c
67     keyfiles.h
68 zmatsuo 9266 keyfiles-putty.c
69     keyfiles-putty.h
70 nmaya 9255 mac.c
71     mac.h
72 zmatsuo 7456 pkt.c
73     pkt.h
74 nmaya 9255 poly1305.c
75     poly1305.h
76 zmatsuo 7456 resource.h
77     sftp.c
78     sftp.h
79     ssh.c
80     ssh.h
81 nmaya 9255 ssherr.c
82     ssherr.h
83     ttxssh-version.h
84     ttxssh-version.rc
85 zmatsuo 7456 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 zmatsuo 7952 target_sources(
97 zmatsuo 9129 ${PACKAGE_NAME}
98 zmatsuo 7952 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 doda 8445 ../../teraterm/common/layer_for_unicode.h
109     ../../teraterm/common/compat_win.h
110     ../../teraterm/common/dllutil.h
111 zmatsuo 7952 )
112 zmatsuo 7456
113 zmatsuo 7952 source_group(
114     "common"
115     REGULAR_EXPRESSION
116     "teraterm\/common\/")
117    
118 zmatsuo 9129 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 zmatsuo 9136 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 zmatsuo 9129 endif(SUPPORT_OLD_WINDOWS)
141    
142 zmatsuo 7952 target_include_directories(
143 zmatsuo 9129 ${PACKAGE_NAME}
144 zmatsuo 7952 PRIVATE
145 zmatsuo 7456 ../../teraterm/teraterm
146     ../../teraterm/common
147     ../matcher
148     ../putty
149     ${OPENSSL_INCLUDE_DIRS}
150     ${ZLIB_INCLUDE_DIRS}
151 zmatsuo 7952 )
152 zmatsuo 7456
153 zmatsuo 7536 set_target_properties(
154 zmatsuo 9129 ${PACKAGE_NAME}
155 zmatsuo 7536 PROPERTIES
156     PREFIX ""
157 zmatsuo 9129 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
158 zmatsuo 7536 )
159    
160 zmatsuo 7952 target_compile_definitions(
161 zmatsuo 9129 ${PACKAGE_NAME}
162 zmatsuo 7952 PRIVATE
163     $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
164     )
165    
166 zmatsuo 9129 if(MINGW)
167     target_link_options(
168     ttxssh
169     PRIVATE
170     -Wl,-Map=ttxssh.map,-cref
171     )
172     endif()
173    
174 zmatsuo 7456 target_link_libraries(
175 zmatsuo 9129 ${PACKAGE_NAME}
176 zmatsuo 8565 PRIVATE
177     common_static
178 zmatsuo 7456 libputty
179     ttpcmn
180 zmatsuo 9266 argon2
181 zmatsuo 7952 ${ZLIB_LIB}
182 zmatsuo 7456 ${OPENSSL_LIB}
183     #
184     ws2_32
185     gdi32
186     comdlg32
187 doda 8445 comctl32
188 zmatsuo 8332 # OpenSSL が使用
189     crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
190 zmatsuo 7456 )
191    
192     ### create puttyversion.h
193    
194 zmatsuo 7532 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 zmatsuo 7456 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 zmatsuo 7990
216     install(
217     TARGETS ttxssh
218     RUNTIME
219     DESTINATION .
220     )
221 zmatsuo 8681
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