[Ttssh2-commit] [7657] cmakeでdebugビルド時、_DEBUGをdefineするようにした。version_info.h内にbuild_typeを出力するようにした。

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 5月 8日 (水) 01:48:02 JST


Revision: 7657
          https://osdn.net/projects/ttssh2/scm/svn/commits/7657
Author:   zmatsuo
Date:     2019-05-08 01:48:01 +0900 (Wed, 08 May 2019)
Log Message:
-----------
cmakeでdebugビルド時、_DEBUGをdefineするようにした。version_info.h内にbuild_typeを出力するようにした。

Modified Paths:
--------------
    trunk/CMakeLists.txt
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/ttpmacro/ttmacro.cpp
    trunk/version_info.h.in

-------------- next part --------------
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2019-05-07 16:47:37 UTC (rev 7656)
+++ trunk/CMakeLists.txt	2019-05-07 16:48:01 UTC (rev 7657)
@@ -50,10 +50,12 @@
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
   endif()
 elseif(MINGW)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections ${C_ONLY_FLAGS}")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections")
+  set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
   if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-05-07 16:47:37 UTC (rev 7656)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-05-07 16:48:01 UTC (rev 7657)
@@ -119,8 +119,10 @@
 #ifdef _DEBUG
 #define malloc(l)	_malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__)
 #define free(p)		_free_dbg((p), _NORMAL_BLOCK)
+#if defined(_MSC_VER)
 #define new  		::new(_NORMAL_BLOCK, __FILE__, __LINE__)
 #endif
+#endif
 
 // \x83E\x83B\x83\x93\x83h\x83E\x8Dő剻\x83{\x83^\x83\x93\x82\xF0\x97L\x8C\xF8\x82ɂ\xB7\x82\xE9 (2005.1.15 yutaka)
 #define WINDOW_MAXMIMUM_ENABLED 1

Modified: trunk/teraterm/ttpmacro/ttmacro.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmacro.cpp	2019-05-07 16:47:37 UTC (rev 7656)
+++ trunk/teraterm/ttpmacro/ttmacro.cpp	2019-05-07 16:48:01 UTC (rev 7657)
@@ -49,7 +49,7 @@
 #include "ttmlib.h"
 #include "ttlib.h"
 
-#ifdef _DEBUG
+#if defined(_MSC_VER) && defined(_DEBUG)
 #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
 #endif
 
@@ -115,7 +115,7 @@
 	DWORD SleepTick = 1;
 
 #ifdef _DEBUG
-	::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 #endif
 
 	init();
@@ -158,10 +158,10 @@
 		}
 	}
 
-	// TODO \x82\xB7\x82łɕ‚\xB6\x82\xE7\x82\xEA\x82Ă\xA2\x82\xE9\x81A\x82\xB1\x82̏\x88\x97\x9D\x95s\x97v?
-	if (pCCtrlWindow) {
-		pCCtrlWindow->DestroyWindow();
-	}
+	pCCtrlWindow->DestroyWindow();
+	delete pCCtrlWindow;
 	pCCtrlWindow = NULL;
+
+	DLLExit();
 	return ExitCode;
 }

Modified: trunk/version_info.h.in
===================================================================
--- trunk/version_info.h.in	2019-05-07 16:47:37 UTC (rev 7656)
+++ trunk/version_info.h.in	2019-05-07 16:48:01 UTC (rev 7657)
@@ -11,6 +11,8 @@
 //  @CMAKE_GENERATOR@
 // CMAKE_GENERATOR_TOOLSET (VS 2010 and above)
 //  @CMAKE_GENERATOR_TOOLSET@
+// CMAKE_BUILD_TYPE (single-configuration generator)
+//  @CMAKE_BUILD_TYPE@
 // CMAKE_COMMAND
 //  @CMAKE_COMMAND@
 // CMAKE_C_COMPILER


Ttssh2-commit メーリングリストの案内
Back to archive index