[Chinese-commits] [fqterm] 18/76: Modify to build with mingw toolchain

Boyuan Yang hosiet-guest at moszumanska.debian.org
Thu Oct 27 03:16:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

hosiet-guest pushed a commit to branch master
in repository fqterm.

commit 8a28eeaaecf3e308c6950f8e3af3f7e9294db284
Author: Iru Cai <mytbk920423 at gmail.com>
Date:   Mon May 5 00:05:08 2014 +0800

    Modify to build with mingw toolchain
---
 CMakeLists.txt              |  6 +++-
 CMakeLists.txt.mingw        | 84 +++++++++++++++++++++++++++++++++++++++++++++
 src/common/fqterm_trace.cpp |  8 ++---
 src/common/fqterm_trace.h   |  8 +++--
 src/utilities/fqwcwidth.h   |  2 +-
 5 files changed, 100 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd3213f..e55eed6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,7 +66,11 @@ ENDIF(NOT FQ_CORE_QT_CONFIG MATCHES "static")
 SET(SUB_CMAKELIST "UNKNOWN")
 
 IF(WIN32)
-  SET(SUB_CMAKELIST "CMakeLists.txt.win32")
+  IF(MSYS MATCHES 1)
+    SET(SUB_CMAKELIST "CMakeLists.txt.mingw")
+  ELSE(MSYS MATCHES 1)
+    SET(SUB_CMAKELIST "CMakeLists.txt.win32")
+  ENDIF(MSYS MATCHES 1)
 ELSE(WIN32)
   IF(APPLE)
     SET(SUB_CMAKELIST "CMakeLists.txt.macos")
diff --git a/CMakeLists.txt.mingw b/CMakeLists.txt.mingw
new file mode 100644
index 0000000..bdb3cfd
--- /dev/null
+++ b/CMakeLists.txt.mingw
@@ -0,0 +1,84 @@
+#set(OPENSSL_INCLUDE_DIR
+#"C:/openssl/include"
+#)
+
+#set(OPENSSL_LIBRARIES
+#"C:/openssl/lib/libeay32.lib"
+#"C:/openssl/lib/ssleay32.lib"
+#)
+
+#set(NETWORK_LIBRARIES
+#"ws2_32.lib"
+#)
+
+#SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /Od /MD")
+
+#ADD_DEFINITIONS(/D USE_DOTNET_STYLE)
+#ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
+ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")
+
+if(FQTERM_USE_STATIC_QT)
+  ADD_DEFINITIONS(-DFQTERM_USE_STATIC_QT)
+  REMOVE_DEFINITIONS(-DQT_DLL)
+endif(FQTERM_USE_STATIC_QT)
+
+add_subdirectory(src)
+
+set(fqterm_RCS
+  fqterm.rc    
+)
+
+include_directories(
+  ${QT_INCLUDE_DIR}
+  ${QT_QTCORE_INCLUDE_DIR}
+  ${QT_QTGUI_INCLUDE_DIR}
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/common
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/terminal
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/utilities
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/ui
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/unite
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/unite
+)
+
+link_directories(
+  ${QT_PLUGINS_DIR}/codecs
+  ${QT_PLUGINS_DIR}/imageformats
+)
+
+ADD_EXECUTABLE(fqterm
+  src/fqterm/main.cpp
+)
+
+#if(FQTERM_USE_STATIC_QT)
+  set(FQ_QT_STATIC_PLUGINS
+    qcncodecs qjpcodecs qkrcodecs qtwcodecs
+    qjpeg qgif qmng)
+#endif(FQTERM_USE_STATIC_QT)
+
+target_link_libraries(fqterm 
+  fqterm_main
+  fqterm_terminal
+  fqterm_protocol
+  fqterm_utilities
+  fqterm_ui
+  fqterm_common
+  fqterm_unite
+  ${QT_LIBRARIES}
+  ${QT_QTNETWORK_LIBRARIES}
+  ${QT_QTSCRIPT_LIBRARIES}  
+  ${QT_QTXML_LIBRARIES}  
+  ${FQ_QT_STATIC_PLUGINS}
+  ${PYTHON_LIB}
+)
+
+add_dependencies(fqterm
+  fqterm_main
+  fqterm_common
+  fqterm_terminal
+  fqterm_protocol
+  fqterm_ui
+  fqterm_unite
+  fqterm_utilities
+  fqterm_unite
+)
diff --git a/src/common/fqterm_trace.cpp b/src/common/fqterm_trace.cpp
index 867b7ad..b08d8d0 100644
--- a/src/common/fqterm_trace.cpp
+++ b/src/common/fqterm_trace.cpp
@@ -20,7 +20,7 @@
 
 #include <string>
 
-#ifdef WIN32
+#ifdef _MSC_VER
 #include <hash_set>
 #else
 #include <set>
@@ -47,10 +47,10 @@ void setMaxTraceLevel(int max_trace_level) {
                       << max_trace_level;
 }
 
-#ifdef WIN32
+#ifdef _MSC_VER
 typedef stdext::hash_set<std::string> CategorySet;
 #else
-typedef std::set<std::string> CategorySet;
+typedef typename std::set<std::string> CategorySet;
 #endif
 
 CategorySet *getAllowedCategories() {
@@ -279,7 +279,7 @@ const char *getEventName(unsigned int type) {
  * This assumes all Win32 compilers have 64-bit support.
  */
 
-#include <Windows.h>
+#include <windows.h>
 
 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__WATCOMC__)
   #define DELTA_EPOCH_IN_USEC  11644473600000000Ui64
diff --git a/src/common/fqterm_trace.h b/src/common/fqterm_trace.h
index 287a8a8..fc4b82d 100644
--- a/src/common/fqterm_trace.h
+++ b/src/common/fqterm_trace.h
@@ -60,8 +60,12 @@ int isAllowedCategory(const char *category, int trace_level);
 void addAllowedCategory(const char *category);
 
 static void soft_break() {
-#if defined(WIN32)
-  __asm int 03h;
+#ifdef WIN32
+#ifdef _MSC_VER
+    __asm int 03h;
+#else
+    asm("int $0x03");
+#endif
 #else
   pause();
 #endif
diff --git a/src/utilities/fqwcwidth.h b/src/utilities/fqwcwidth.h
index b2007bc..2eb4516 100644
--- a/src/utilities/fqwcwidth.h
+++ b/src/utilities/fqwcwidth.h
@@ -21,7 +21,7 @@
 #ifndef FQTERM_FQWCWIDTH_H
 #define FQTERM_FQWCWIDTH_H
 
-#ifdef WIN32
+#ifdef _MSC_VER
 #define uint32_t unsigned __int32
 #define uint16_t unsigned __int16
 typedef wchar_t UTF16;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/chinese/fqterm.git



More information about the Chinese-commits mailing list