aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/spdlog/001-windows-pdb-symbol-gen.patch
blob: bae76d2c219d64aeff8cac3584e79c60e865f910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -236,6 +236,26 @@
     endif()
 endforeach()
 
+if(WIN32 OR WINDOWS_STORE)
+  set_target_properties(spdlog
+    PROPERTIES
+      COMPILE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
+      PDB_NAME spdlog
+      PDB_NAME_DEBUG spdlogd
+      COMPILE_PDB_NAME spdlog
+      COMPILE_PDB_NAME_DEBUG spdlogd
+  )
+  target_compile_options(spdlog PRIVATE /sdl-
+                                        /EHsc
+                                        /WX-
+  )
+  target_link_options(spdlog
+    PRIVATE
+      /INCREMENTAL:NO
+      /debug:full
+  )
+endif()
+
 if(SPDLOG_NO_EXCEPTIONS AND NOT MSVC)
     target_compile_options(spdlog PRIVATE -fno-exceptions)
 endif()
@@ -293,6 +313,22 @@
     endif()
 
     # ---------------------------------------------------------------------------------------
+    # Windows PDB debug files
+    # ---------------------------------------------------------------------------------------
+    if(WIN32 OR WINDOWS_STORE)
+      install(FILES
+          ${PROJECT_BINARY_DIR}/Debug/spdlogd.pdb
+          DESTINATION lib
+          CONFIGURATIONS Debug
+      )
+      install(FILES
+          ${PROJECT_BINARY_DIR}/RelWithDebInfo/spdlog.pdb
+          DESTINATION lib
+          CONFIGURATIONS RelWithDebInfo
+      )
+    endif()
+
+    # ---------------------------------------------------------------------------------------
     # Install pkg-config file
     # ---------------------------------------------------------------------------------------
     get_target_property(PKG_CONFIG_DEFINES spdlog INTERFACE_COMPILE_DEFINITIONS)