Sfoglia il codice sorgente

Z991239-527 #comment fix: libPublicFunc 在 linux 下编译

gifur 5 anni fa
parent
commit
8e25278fdb

+ 0 - 3
Other/libpublicFun/CMakeLists.txt

@@ -3,9 +3,6 @@ set(MODULE_PREFIX "LIB_PUBLIC_FUNC")
 
 set(${MODULE_PREFIX}_SRCS
 	dllmain.cpp
-	framework.h
-	pch.h
-	pch.cpp
 	publicFunExport.h
 	publicFunExport.cpp
 

+ 16 - 15
Other/libpublicFun/dllmain.cpp

@@ -1,19 +1,20 @@
-// dllmain.cpp : 定义 DLL 应用程序的入口点。
-#include "pch.h"
+#ifdef _WIN32
 
-BOOL APIENTRY DllMain( HMODULE hModule,
-                       DWORD  ul_reason_for_call,
-                       LPVOID lpReserved
-                     )
+BOOL APIENTRY DllMain(HMODULE hModule,
+	DWORD  ul_reason_for_call,
+	LPVOID lpReserved
+)
 {
-    switch (ul_reason_for_call)
-    {
-    case DLL_PROCESS_ATTACH:
-    case DLL_THREAD_ATTACH:
-    case DLL_THREAD_DETACH:
-    case DLL_PROCESS_DETACH:
-        break;
-    }
-    return TRUE;
+	switch (ul_reason_for_call) {
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
 }
 
+#endif //_WIN32
+
+

+ 0 - 5
Other/libpublicFun/framework.h

@@ -1,5 +0,0 @@
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN             // 从 Windows 头文件中排除极少使用的内容
-// Windows 头文件
-#include <windows.h>

+ 0 - 5
Other/libpublicFun/pch.cpp

@@ -1,5 +0,0 @@
-// pch.cpp: 与预编译标头对应的源文件
-
-#include "pch.h"
-
-// 当使用预编译的头时,需要使用此源文件,编译才能成功。

+ 0 - 13
Other/libpublicFun/pch.h

@@ -1,13 +0,0 @@
-// pch.h: 这是预编译标头文件。
-// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
-// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
-// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
-// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
-
-#ifndef PCH_H
-#define PCH_H
-
-// 添加要在此处预编译的标头
-#include "framework.h"
-
-#endif //PCH_H

+ 10 - 7
Other/libpublicFun/publicFunExport.h

@@ -3,14 +3,17 @@
 #include <map>
 #include <string>
 
-#ifdef PUBLIC_EXPORTS
-#ifndef PUBLIC_API
-#define PUBLIC_API __declspec(dllexport)
-#endif
+
+#ifdef _WIN32
+#   ifdef PUBLIC_EXPORTS
+#       define PUBLIC_API __declspec(dllexport)
+#   else
+#       define PUBLIC_API __declspec(dllimport)
+#   endif
+#elif __GNUC__ >= 4
+#   define PUBLIC_API __attribute__((visibility("default")))
 #else
-#ifndef PUBLIC_API
-#define PUBLIC_API __declspec(dllimport)
-#endif
+#   define PUBLIC_API
 #endif
 
 PUBLIC_API std::pair<bool, std::string> generateJsonStr(std::map<std::string, std::string> &objectArr);