Selaa lähdekoodia

plugin/external-plugin: 处理 Windows 中一些编译异常的问题

zinface 2 vuotta sitten
vanhempi
sitoutus
025e0e8f65

+ 17 - 4
src/plugin/external-plugin/CMakeLists.txt

@@ -83,7 +83,20 @@ endif(UNIX)
 
 
 # ----------------- external-plugin 构建的外部项目依赖 ----------------- #
-add_library(external-plugin-say SHARED external-plugin/base.cpp)
-set_target_properties(external-plugin-say
-    PROPERTIES
-        LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugin/external-plugins")
+add_library(external-plugin-base SHARED external-plugin/base.cpp)
+
+if(WIN32)
+    target_compile_features(external-plugin-base PUBLIC  cxx_std_20)
+    set_target_properties(external-plugin-base
+        PROPERTIES
+            LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugin/external-plugins"
+            ARCHIVE_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugin/external-plugins"
+            RUNTIME_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugin/external-plugins")
+endif(WIN32)
+
+if(UNIX)
+    set_target_properties(external-plugin-base
+        PROPERTIES
+            LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugin/external-plugins"
+endif(UNIX)
+

+ 1 - 0
src/plugin/external-plugin/ndd_plugin_implement.cpp

@@ -8,6 +8,7 @@
 #include <QFunctionPointer>
 
 #include "external-plugin/interface/external.h"
+#include <QApplication>
 #include <QDesktopWidget>
 #include <QDesktopServices>
 #include <QUrl>

+ 1 - 1
src/plugin/external-plugin/plugin.cpp

@@ -6,6 +6,6 @@
 #include "ndd_plugin_implement.h"
 
 
-NOTEPAD_PLUGIN_METADATA_IDENTIFY_V1("外部插件扩展测试", "0.1", "zinface", u8"基于 QMainWindow Ui 的插件", "");
+NOTEPAD_PLUGIN_METADATA_IDENTIFY_V1(u8"外部插件扩展测试", "0.1", "zinface", u8"基于 QMainWindow Ui 的插件", "");
 
 NOTEPAD_PLUGIN_METADATA_IMPLEMENT_V1(NddPluginImplement, false);