diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2022-03-16 19:24:00 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-16 19:24:00 +1000 |
commit | d0eeee1ce36434df7fba240a37b16782720b2f6d (patch) | |
tree | 8531153805627ddde59611d55fd423b183015049 /tools | |
parent | c22c0c69281246f5a735bc10bf2bfdcfb1aa2faf (diff) | |
parent | a22af94995f300288826fe991619ed66f1ff4b67 (diff) |
Merge pull request #21108 from fuzzard/cmake_winspdlog
[Cmake] FindSpdlog/FMT ENABLE_INTERNAL_* for windows
Diffstat (limited to 'tools')
-rw-r--r-- | tools/depends/target/fmt/001-windows-pdb-symbol-gen.patch | 42 | ||||
-rw-r--r-- | tools/depends/target/fmt/FMT-VERSION | 1 | ||||
-rw-r--r-- | tools/depends/target/spdlog/001-windows-pdb-symbol-gen.patch | 52 | ||||
-rw-r--r-- | tools/depends/target/spdlog/SPDLOG-VERSION | 1 |
4 files changed, 96 insertions, 0 deletions
diff --git a/tools/depends/target/fmt/001-windows-pdb-symbol-gen.patch b/tools/depends/target/fmt/001-windows-pdb-symbol-gen.patch new file mode 100644 index 0000000000..fed1a83a89 --- /dev/null +++ b/tools/depends/target/fmt/001-windows-pdb-symbol-gen.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -268,9 +268,20 @@ + + set(FMT_DEBUG_POSTFIX d CACHE STRING "Debug library postfix.") + ++if (WIN32 OR WINDOWS_STORE) ++ set_target_properties(fmt PROPERTIES ++ VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} ++ OUTPUT_NAME fmt ++ OUTPUT_NAME_DEBUG fmt${FMT_DEBUG_POSTFIX} ++ COMPILE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} ++ COMPILE_PDB_NAME fmt ++ COMPILE_PDB_NAME_DEBUG fmt${FMT_DEBUG_POSTFIX} ++ ) ++else() + set_target_properties(fmt PROPERTIES + VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} + DEBUG_POSTFIX "${FMT_DEBUG_POSTFIX}") ++endif() + + # Set FMT_LIB_NAME for pkg-config fmt.pc. We cannot use the OUTPUT_NAME target + # property because it's not set by default. +@@ -361,6 +372,18 @@ + install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR} + NAMESPACE fmt::) + ++ # Install COMPILE_PDB Files for windows ++ if(NOT BUILD_SHARED_LIBS AND (WIN32 OR WINDOWS_STORE)) ++ install(FILES ${PROJECT_BINARY_DIR}/RelWithDebInfo/fmt.pdb ++ DESTINATION lib ++ CONFIGURATIONS RelWithDebInfo ++ ) ++ install(FILES ${PROJECT_BINARY_DIR}/Debug/fmtd.pdb ++ DESTINATION lib ++ CONFIGURATIONS Debug ++ ) ++ endif() ++ + install(FILES $<TARGET_PDB_FILE:${INSTALL_TARGETS}> + DESTINATION ${FMT_LIB_DIR} OPTIONAL) + install(FILES ${FMT_HEADERS} DESTINATION "${FMT_INC_DIR}/fmt") diff --git a/tools/depends/target/fmt/FMT-VERSION b/tools/depends/target/fmt/FMT-VERSION index dc41a75ec0..cbaa58dd7d 100644 --- a/tools/depends/target/fmt/FMT-VERSION +++ b/tools/depends/target/fmt/FMT-VERSION @@ -3,3 +3,4 @@ VERSION=8.0.1 ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz SHA512=643e68d5b2e0e9c83231ab2b0036596a6297b1d9ed6bd7b1172bee4ff134c8af8f09174c06c94225132c1b635b0977ea4ce783748d7bd76a9a0b5ad597456c84 BYPRODUCT=libfmt.a +BYPRODUCT_WIN=fmt.lib diff --git a/tools/depends/target/spdlog/001-windows-pdb-symbol-gen.patch b/tools/depends/target/spdlog/001-windows-pdb-symbol-gen.patch new file mode 100644 index 0000000000..bae76d2c21 --- /dev/null +++ b/tools/depends/target/spdlog/001-windows-pdb-symbol-gen.patch @@ -0,0 +1,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) diff --git a/tools/depends/target/spdlog/SPDLOG-VERSION b/tools/depends/target/spdlog/SPDLOG-VERSION index 197b04c63b..07bf4e9e97 100644 --- a/tools/depends/target/spdlog/SPDLOG-VERSION +++ b/tools/depends/target/spdlog/SPDLOG-VERSION @@ -3,3 +3,4 @@ VERSION=1.9.2 ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz SHA512=87b12a792cf2d740ef29db4b6055788a487b6d474662b878711b8a5534efea5f0d97b6ac357834500b66cc65e1ba8934446a695e9691fd5d4b95397b6871555c BYPRODUCT=libspdlog.a +BYPRODUCT_WIN=spdlog.lib |