xx 2 yıl önce
ebeveyn
işleme
bfd6decaf5
3 değiştirilmiş dosya ile 10 ekleme ve 9 silme
  1. 3 6
      CMakeLists.txt
  2. 5 1
      src/core/entry.cpp
  3. 2 2
      tests/main.cpp

+ 3 - 6
CMakeLists.txt

@@ -6,7 +6,7 @@ project("fastweb")
 
 # 设置自定义配置类型
 if(MSVC)
-	set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugDll;ReleaseDll" CACHE STRING "Build config types" FORCE)
+	set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Build config types" FORCE)
 endif()
 # C++等级
 set(CMAKE_CXX_STANDARD 20)
@@ -64,8 +64,7 @@ link_directories(/usr/lib/x86_64-linux-gnu)
 link_directories(/usr/local/lib)
 
 if(MSVC)
-	function(target_link_common_libraries target_name)
-		target_link_libraries(${target_name} 
+	target_link_libraries(${FASTWEBCORE} PRIVATE
 			odbc32.lib
 			User32.lib
 			Advapi32.lib
@@ -105,9 +104,7 @@ if(MSVC)
 			$<$<CONFIG:Release>:${PROJECT_SOURCE_DIR}/3rdparty/soci/lib/Release/soci_core_4_1.lib>
 			$<$<CONFIG:Release>:${PROJECT_SOURCE_DIR}/3rdparty/soci/lib/Release/soci_empty_4_1.lib>
 			$<$<CONFIG:Release>:${PROJECT_SOURCE_DIR}/3rdparty/soci/lib/Release/soci_odbc_4_1.lib>
-		)
-	endfunction()
-	target_link_common_libraries(${FASTWEBCORE})
+	)
 
 	target_link_libraries(${PROJECT_NAME} ${FASTWEBCORE})
 else()

+ 5 - 1
src/core/entry.cpp

@@ -3,7 +3,11 @@
 #include "util/system.h"
 #include "core/define.h"
 #include "core/config.h"
-extern "C" {
+#include "entry.h"
+extern "C" { 
+#ifdef _WIN32
+	DLL_EXPORT
+#endif
 	int fastweb(const char* config_filepath)
 	{
 		std::cout << "=========== [fastweb engine] ============" << std::endl;

+ 2 - 2
tests/main.cpp

@@ -1,10 +1,10 @@
 #pragma once
 #include <iostream>
 #include "core/entry.h"
-#include "util/system.h"
+#include <filesystem>
 int main()
 {
-	std::string config_filepath = system::current_dir() + "/config.ini";
+	std::string config_filepath = std::filesystem::current_path().string()+"/config.ini";
 	if (fastweb(config_filepath.c_str()) != 0)
 		return -1;