• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7952 (tree)
Time2019-08-14 01:22:11
Authorzmatsuo

Log Message

ttxsshをdebugビルド時マクロ再定義警告が出ないようにした

- r7949 以外に codeconv.cpp でも警告が出ていた
- ttxssh を cmake でビルドするときにも _CRTDBG_MAP_ALLOC を define するようにした
- ttxssh/CMakeLists.txt を非推奨コマンドをなるべく使わないように修正

Change Summary

Incremental Difference

--- trunk/teraterm/common/codeconv.cpp (revision 7951)
+++ trunk/teraterm/common/codeconv.cpp (revision 7952)
@@ -47,7 +47,7 @@
4747 typedef unsigned int uint32_t;
4848 #endif
4949
50-#ifdef _DEBUG
50+#if defined(_DEBUG) && !defined(_CRTDBG_MAP_ALLOC)
5151 #define malloc(l) _malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__)
5252 #define free(p) _free_dbg((p), _NORMAL_BLOCK)
5353 #define _strdup(s) _strdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)
--- trunk/ttssh2/ttxssh/CMakeLists.txt (revision 7951)
+++ trunk/ttssh2/ttxssh/CMakeLists.txt (revision 7952)
@@ -5,34 +5,17 @@
55 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
66 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
77
8-if(USE_UNICODE_API)
9- add_definitions(-DUNICODE -D_UNICODE)
8+if (MSVC)
9+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:dnsapi.dll")
1010 endif()
1111
12-set(COMMON_SRC
13- ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
14- ../../teraterm/common/ttcommon.h
15- ../../teraterm/common/i18n.h
16- ../../teraterm/common/ttlib.h
17- ../../teraterm/common/ttlib.c
18- ../../teraterm/common/dlglib.h
19- ../../teraterm/common/dlglib.c
20- ../../teraterm/common/dlglib_cpp.cpp
21- ../../teraterm/common/dlglib_tmpl.cpp
22- ../../teraterm/common/servicenames.h
23- ../../teraterm/common/codeconv.cpp
24- ../../teraterm/common/codeconv.h
25- ../../teraterm/common/tipwin.cpp
26- ../../teraterm/common/tipwin.h
12+add_library(
13+ ttxssh SHARED
2714 )
2815
29-source_group(
30- "common"
31- FILES
32- ${COMMON_SRC}
33- )
34-
35-set(SRC
16+target_sources(
17+ ttxssh
18+ PRIVATE
3619 ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
3720 ../matcher/matcher.c
3821 arc4random.c
@@ -98,8 +81,33 @@
9881 ${COMMON_SRC}
9982 )
10083
84+target_sources(
85+ ttxssh
86+ PRIVATE
87+ ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
88+ ../../teraterm/common/ttcommon.h
89+ ../../teraterm/common/i18n.h
90+ ../../teraterm/common/ttlib.h
91+ ../../teraterm/common/ttlib.c
92+ ../../teraterm/common/dlglib.h
93+ ../../teraterm/common/dlglib.c
94+ ../../teraterm/common/dlglib_cpp.cpp
95+ ../../teraterm/common/dlglib_tmpl.cpp
96+ ../../teraterm/common/servicenames.h
97+ ../../teraterm/common/codeconv.cpp
98+ ../../teraterm/common/codeconv.h
99+ ../../teraterm/common/tipwin.cpp
100+ ../../teraterm/common/tipwin.h
101+ )
101102
102-include_directories(
103+source_group(
104+ "common"
105+ REGULAR_EXPRESSION
106+ "teraterm\/common\/")
107+
108+target_include_directories(
109+ ttxssh
110+ PRIVATE
103111 ../../teraterm/teraterm
104112 ../../teraterm/common
105113 ../matcher
@@ -106,21 +114,8 @@
106114 ../putty
107115 ${OPENSSL_INCLUDE_DIRS}
108116 ${ZLIB_INCLUDE_DIRS}
109- )
117+)
110118
111-link_directories(
112- ${ZLIB_LIBRARY_DIRS}
113- )
114-
115-if (MSVC)
116- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:dnsapi.dll")
117-endif()
118-
119-add_library(
120- ttxssh SHARED
121- ${SRC}
122- )
123-
124119 set_target_properties(
125120 ttxssh
126121 PROPERTIES
@@ -127,12 +122,26 @@
127122 PREFIX ""
128123 )
129124
125+target_compile_definitions(
126+ ttxssh
127+ PRIVATE
128+ $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
129+ )
130+if(USE_UNICODE_API)
131+ target_compile_definitions(
132+ ttxssh
133+ PRIVATE
134+ UNICODE
135+ _UNICODE
136+ )
137+endif()
138+
139+
130140 target_link_libraries(
131141 ttxssh
132142 libputty
133143 ttpcmn
134- debug zlibstaticd
135- optimized zlibstatic
144+ ${ZLIB_LIB}
136145 ${OPENSSL_LIB}
137146 #
138147 ws2_32
Show on old repository browser