From a22af94995f300288826fe991619ed66f1ff4b67 Mon Sep 17 00:00:00 2001 From: fuzzard Date: Sat, 12 Mar 2022 11:33:38 +1000 Subject: [cmake] FindFMT enable ENABLE_INTERNAL_FMT for windows --- .../target/fmt/001-windows-pdb-symbol-gen.patch | 42 ++++++++++++++++++++++ tools/depends/target/fmt/FMT-VERSION | 1 + 2 files changed, 43 insertions(+) create mode 100644 tools/depends/target/fmt/001-windows-pdb-symbol-gen.patch (limited to 'tools/depends/target/fmt') 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 $ + 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 -- cgit v1.2.3