From 0bc2be450c7ba6b178b1e23fe98b405cce8ac35c Mon Sep 17 00:00:00 2001
From: Constantin Papizh <p.const@bk.ru>
Date: Wed, 8 Apr 2020 14:53:07 +0300
Subject: [PATCH] Linking errors

---
 CMakeLists.txt           | 10 ++++++----
 src/win32/CMakeLists.txt | 10 ++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)
 create mode 100644 src/win32/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06617e6..3596dbe 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,13 +21,10 @@ if(WIN32)
   file(GLOB CORE_SRCS 
       src/*.c 
       src/etc/*.c 
-      src/win32/*.c 
       src/rpmalloc/*.c
   )
   file(GLOB CORE_HEADERS 
       include/*.h 
-      src/win32/*.h 
-      src/win32/*.h 
   )
 endif()
 
@@ -81,7 +78,7 @@ if(NOT (${SUBMODULES_NO_BUILD} MATCHES ON))
 	endif()
 endif()
 
-add_library(${PROJECT_NAME} STATIC ${CORE_SRCS} ${CORE_UNIX_SRCS})
+add_library(${PROJECT_NAME} STATIC ${CORE_SRCS} ${CORE_HEADERS})
 
 #This paths will be used by project-dependent project libraries
 target_include_directories(${PROJECT_NAME} INTERFACE include/ src/rpmalloc/)
@@ -109,6 +106,11 @@ if(ANDROID)
     target_link_libraries(${PROJECT_NAME} dap_core_android)
 endif()
 
+if (WIN32)
+    add_subdirectory(src/win32)
+    target_link_libraries(${PROJECT_NAME} dap_core_win32)
+endif()
+
 if(BUILD_DAP_TESTS)
     enable_testing()
     add_subdirectory(test)
diff --git a/src/win32/CMakeLists.txt b/src/win32/CMakeLists.txt
new file mode 100644
index 0000000..f3d0c43
--- /dev/null
+++ b/src/win32/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.0)
+
+project (dap_core_win32 C)
+
+file(GLOB CORE_SRCS *.c)
+file(GLOB CORE_HEADERS *.h)
+
+add_library(${PROJECT_NAME} STATIC ${CORE_SRCS} ${CORE_HEADERS})
+
+target_include_directories(${PROJECT_NAME} INTERFACE .)
\ No newline at end of file
-- 
GitLab