• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン7167 (tree)
日時2018-07-27 11:25:57
作者maya

ログメッセージ

CMakeLists.txt のライブラリ依存関係などを修正

- /MD ではなく /MT でリンク
- Release と Debug で違うライブラリファイルをリンク
- Release と Debug で違う /NODEFAULTLIB を指定
- /NODEFAULTLIB を複数指定するときの書き方を修正
- dll の遅延読み込みを指定
- ttpmacro を DLL の指定でコンパイルしているのを修正
- ライブラリの依存関係とプロジェクトの依存関係を別に記述

変更サマリ

差分

--- branches/cmake/teraterm/ttptek/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/ttptek/CMakeLists.txt (revision 7167)
@@ -1,6 +1,16 @@
1-
21 project(ttptek)
32
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
414 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
515
616 set(SRC
@@ -23,6 +33,7 @@
2333 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SFMT
2434 ${CMAKE_CURRENT_SOURCE_DIR}/../common
2535 )
36+
2637 link_directories(
2738 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/oniguruma/src
2839 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SFMT
@@ -36,7 +47,14 @@
3647 target_link_libraries(
3748 ttptek
3849 ttpcmn
39- onig_s.lib
40- SFMT.lib
50+ optimized onig_s.lib
51+ debug onig_sd.lib
52+ optimized SFMT.lib
53+ debug SFMTd.lib
4154 iphlpapi.lib
42-)
55+ )
56+
57+add_dependencies(
58+ ttptek
59+ ttpcmn
60+ )
--- branches/cmake/teraterm/keycode/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/keycode/CMakeLists.txt (revision 7167)
@@ -1,5 +1,16 @@
11 project(keycode)
22
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
314 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
415
516 set(SRC
@@ -10,18 +21,17 @@
1021 kc_res.h
1122 )
1223
13-
1424 include_directories(
1525 ../common
1626 ../ttpfile
1727 .
1828 )
29+
1930 add_executable(
2031 keycode WIN32
2132 ${SRC}
2233 )
34+
2335 target_link_libraries(
2436 keycode
2537 )
26-
27-
--- branches/cmake/teraterm/svnrev/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/svnrev/CMakeLists.txt (revision 7167)
@@ -7,18 +7,17 @@
77 svnrev.h
88 )
99
10-
1110 include_directories(
1211 ../common
1312 ../ttpfile
1413 .
1514 )
15+
1616 add_executable(
1717 svnrev
1818 ${SRC}
1919 )
20+
2021 target_link_libraries(
2122 svnrev
2223 )
23-
24-
--- branches/cmake/teraterm/teraterm/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/teraterm/CMakeLists.txt (revision 7167)
@@ -1,5 +1,16 @@
11 project(teraterm)
22
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
314 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
415
516 set(SRC
@@ -79,36 +90,51 @@
7990 WSAAsyncGetAddrInfo.h
8091 )
8192
82-
8393 include_directories(
8494 ../common
8595 ../ttpfile
8696 .
8797 )
98+
8899 link_directories(
89100 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/oniguruma/src
90101 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SFMT
91102 )
103+
92104 set(CMAKE_MFC_FLAG 1)
93-set(CMAKE_EXE_LINKER_FLAGS /NODEFAULTLIB:\"nafxcwd.lib,LIBCMTD.lib\")
105+
106+set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:nafxcw.lib /NODEFAULTLIB:LIBCMT.lib")
107+set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:nafxcwd.lib /NODEFAULTLIB:LIBCMTD.lib")
108+set(CMAKE_EXE_LINKER_FLAGS "/DELAYLOAD:imagehlp.dll /DELAYLOAD:user32.dll /DELAYLOAD:shell32.dll")
109+
94110 add_executable(
95111 teraterm WIN32
96112 ${SRC}
97113 )
114+
98115 target_link_libraries(
99116 teraterm
100- debug nafxcwd.lib
101- debug LIBCMTD.lib
102117 ttpcmn
103118 ttpdlg
104119 ttpfile
105- ttpmacro
106120 ttpset
107121 ttptek
108- onig_s.lib
122+ optimized nafxcw.lib
123+ debug nafxcwd.lib
124+ optimized LIBCMT.lib
125+ debug LIBCMTD.lib
126+ optimized onig_s.lib
127+ debug onig_sd.lib
109128 ws2_32.lib
110129 imm32.lib
111130 imagehlp.lib
112131 )
113132
114-
133+add_dependencies(
134+ teraterm
135+ ttpcmn
136+ ttpdlg
137+ ttpfile
138+ ttpset
139+ ttptek
140+ )
--- branches/cmake/teraterm/ttpset/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/ttpset/CMakeLists.txt (revision 7167)
@@ -1,6 +1,16 @@
1-
21 project(ttpset)
32
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
414 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
515
616 set(SRC
@@ -11,7 +21,6 @@
1121 ttpset.def
1222 )
1323
14-
1524 include_directories(
1625 ${CMAKE_CURRENT_SOURCE_DIR}/../common
1726 )
@@ -25,3 +34,8 @@
2534 ttpset
2635 ttpcmn
2736 )
37+
38+add_dependencies(
39+ ttpset
40+ ttpcmn
41+ )
--- branches/cmake/teraterm/ttpmacro/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/ttpmacro/CMakeLists.txt (revision 7167)
@@ -1,6 +1,16 @@
1-
21 project(ttpmacro)
32
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
414 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
515
616 set(SRC
@@ -49,12 +59,12 @@
4959 ttm-version.rc
5060 )
5161
52-
5362 include_directories(
5463 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/oniguruma/src
5564 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SFMT
5665 ${CMAKE_CURRENT_SOURCE_DIR}/../common
5766 )
67+
5868 link_directories(
5969 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/oniguruma/src
6070 ${CMAKE_CURRENT_SOURCE_DIR}/../../libs/SFMT
@@ -62,10 +72,12 @@
6272
6373 set(CMAKE_MFC_FLAG 1)
6474
65-set(CMAKE_SHARED_LINKER_FLAGS /NODEFAULTLIB:\"LIBCMT.lib,LIBCMTD.lib\")
75+set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:nafxcw.lib /NODEFAULTLIB:LIBCMT.lib")
76+set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:nafxcwd.lib /NODEFAULTLIB:LIBCMTD.lib")
77+set(CMAKE_EXE_LINKER_FLAGS "/DELAYLOAD:iphlpapi.dll /DELAYLOAD:user32.dll")
6678
67-add_library(
68- ttpmacro SHARED
79+add_executable(
80+ ttpmacro WIN32
6981 ${SRC}
7082 )
7183
@@ -74,9 +86,16 @@
7486 ttpcmn
7587 optimized nafxcw.lib
7688 debug nafxcwd.lib
77- optimized libcmt.lib
78- debug libcmtd.lib
79- onig_s.lib
80- SFMT.lib
89+ optimized LIBCMT.lib
90+ debug LIBCMTD.lib
91+ optimized onig_s.lib
92+ debug onig_sd.lib
93+ optimized SFMT.lib
94+ debug SFMTd.lib
8195 iphlpapi.lib
8296 )
97+
98+add_dependencies(
99+ ttpmacro
100+ ttpcmn
101+ )
--- branches/cmake/teraterm/ttpdlg/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/ttpdlg/CMakeLists.txt (revision 7167)
@@ -1,6 +1,16 @@
1-
21 project(ttpdlg)
32
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
414 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
515
616 set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /i ${CMAKE_CURRENT_SOURCE_DIR}/../common")
@@ -37,11 +47,16 @@
3747
3848 target_link_libraries(
3949 ttpdlg
40- onig_s.lib
41- #onig_sd.lib
4250 ttpcmn
51+ optimized onig_s.lib
52+ debug onig_sd.lib
4353 )
4454
55+add_dependencies(
56+ ttpdlg
57+ ttpcmn
58+ )
59+
4560 ## svnversion.h
4661 INCLUDE(FindSubversion)
4762
--- branches/cmake/teraterm/ttpcmn/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/ttpcmn/CMakeLists.txt (revision 7167)
@@ -1,6 +1,16 @@
1-
21 project(ttpcmn)
32
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
414 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
515
616 set(SRC
@@ -18,17 +28,19 @@
1828 ttpcmn.rc
1929 )
2030
21-
2231 include_directories(
2332 ../common
2433 ../ttpfile
2534 .
2635 )
36+
2737 add_library(
2838 ttpcmn SHARED
2939 ${SRC}
3040 )
41+
3142 target_link_libraries(
3243 ttpcmn
3344 setupapi.lib
34- htmlhelp.lib)
45+ htmlhelp.lib
46+ )
--- branches/cmake/teraterm/ttpfile/CMakeLists.txt (revision 7166)
+++ branches/cmake/teraterm/ttpfile/CMakeLists.txt (revision 7167)
@@ -1,6 +1,16 @@
1-
21 project(ttpfile)
32
3+if (MSVC)
4+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
5+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
6+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
7+ string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
8+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
9+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
10+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
11+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
12+endif ()
13+
414 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
515
616 set(SRC
@@ -42,3 +52,8 @@
4252 ttpfile
4353 ttpcmn
4454 )
55+
56+add_dependencies(
57+ ttpfile
58+ ttpcmn
59+ )
旧リポジトリブラウザで表示