diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/glog | |
Diffstat (limited to 'vcpkg/ports/glog')
| -rw-r--r-- | vcpkg/ports/glog/fix_cplusplus_macro.patch | 15 | ||||
| -rw-r--r-- | vcpkg/ports/glog/fix_crosscompile_symbolize.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/glog/fix_glog_CMAKE_MODULE_PATH.patch | 33 | ||||
| -rw-r--r-- | vcpkg/ports/glog/glog_disable_debug_postfix.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/glog/portfile.cmake | 50 | ||||
| -rw-r--r-- | vcpkg/ports/glog/vcpkg-cmake-wrapper.cmake | 6 | ||||
| -rw-r--r-- | vcpkg/ports/glog/vcpkg.json | 30 |
7 files changed, 169 insertions, 0 deletions
diff --git a/vcpkg/ports/glog/fix_cplusplus_macro.patch b/vcpkg/ports/glog/fix_cplusplus_macro.patch new file mode 100644 index 0000000..bd9d0e1 --- /dev/null +++ b/vcpkg/ports/glog/fix_cplusplus_macro.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 985f5f5..bf6600e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -476,6 +476,10 @@ if (CYGWIN OR WIN32) + target_compile_definitions (glog PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES) + endif (CYGWIN OR WIN32) + ++if ((MSVC) AND (MSVC_VERSION GREATER_EQUAL 1914)) ++ target_compile_options(glog INTERFACE "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/Zc:__cplusplus>") ++endif() ++ + set_target_properties (glog PROPERTIES PUBLIC_HEADER "${GLOG_PUBLIC_H}") + + target_include_directories (glog BEFORE PUBLIC diff --git a/vcpkg/ports/glog/fix_crosscompile_symbolize.patch b/vcpkg/ports/glog/fix_crosscompile_symbolize.patch new file mode 100644 index 0000000..e94ce8f --- /dev/null +++ b/vcpkg/ports/glog/fix_crosscompile_symbolize.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fe1d85f..985f5f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -243,6 +243,9 @@ endif (HAVE_EXECINFO_BACKTRACE AND HAVE_EXECINFO_BACKTRACE_SYMBOLS) + + if (WITH_SYMBOLIZE) + if (WIN32 OR CYGWIN) ++ if(CMAKE_CROSSCOMPILING) ++ set(HAVE_SYMBOLIZE 0) ++ else() + cmake_push_check_state (RESET) + set (CMAKE_REQUIRED_LIBRARIES DbgHelp) + +@@ -273,6 +276,7 @@ if (WITH_SYMBOLIZE) + ]=] HAVE_SYMBOLIZE) + + cmake_pop_check_state () ++ endif() + + if (HAVE_SYMBOLIZE) + set (HAVE_STACKTRACE 1) diff --git a/vcpkg/ports/glog/fix_glog_CMAKE_MODULE_PATH.patch b/vcpkg/ports/glog/fix_glog_CMAKE_MODULE_PATH.patch new file mode 100644 index 0000000..39bda83 --- /dev/null +++ b/vcpkg/ports/glog/fix_glog_CMAKE_MODULE_PATH.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b787631..41bf110 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1000,7 +1000,7 @@ write_basic_package_version_file ( + + export (TARGETS glog NAMESPACE glog:: FILE glog-targets.cmake) + export (PACKAGE glog) +- ++if(0) + get_filename_component (_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) + + # Directory containing the find modules relative to the config install +@@ -1036,6 +1036,7 @@ file (INSTALL + " + COMPONENT Development + ) ++endif() + + install (FILES + ${glog_BINARY_DIR}/glog-config.cmake +diff --git a/glog-config.cmake.in b/glog-config.cmake.in +index 7d98525..93bc7d9 100644 +--- a/glog-config.cmake.in ++++ b/glog-config.cmake.in +@@ -5,7 +5,6 @@ endif (CMAKE_VERSION VERSION_LESS @glog_CMake_VERSION@) + @PACKAGE_INIT@ + + include (CMakeFindDependencyMacro) +-include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake) + + find_dependency (Threads) + diff --git a/vcpkg/ports/glog/glog_disable_debug_postfix.patch b/vcpkg/ports/glog/glog_disable_debug_postfix.patch new file mode 100644 index 0000000..8a9db44 --- /dev/null +++ b/vcpkg/ports/glog/glog_disable_debug_postfix.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 41bf110..fe1d85f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,7 +61,7 @@ set (CMAKE_CXX_VISIBILITY_PRESET hidden) + set (CMAKE_POSITION_INDEPENDENT_CODE ON) + set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) + +-set (CMAKE_DEBUG_POSTFIX d) ++#set (CMAKE_DEBUG_POSTFIX d) + + find_package (GTest NO_MODULE) + diff --git a/vcpkg/ports/glog/portfile.cmake b/vcpkg/ports/glog/portfile.cmake new file mode 100644 index 0000000..76cd91e --- /dev/null +++ b/vcpkg/ports/glog/portfile.cmake @@ -0,0 +1,50 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/glog + REF "v${VERSION}" + SHA512 2dabac87d44e4fe58beceb31b22be732b47df84c22f1af8c0e7d0f262de939889de1f16025c1256539f2833ef3393bc92034e983aa2886752bb8705801a68630 + HEAD_REF master + PATCHES + fix_glog_CMAKE_MODULE_PATH.patch + glog_disable_debug_postfix.patch + fix_crosscompile_symbolize.patch + fix_cplusplus_macro.patch +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + unwind WITH_UNWIND + customprefix WITH_CUSTOM_PREFIX + INVERTED_FEATURES + unwind CMAKE_DISABLE_FIND_PACKAGE_Unwind +) +file(REMOVE "${SOURCE_PATH}/glog-modules.cmake.in") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTING=OFF + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glog) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${PORT}/export.h" "#ifdef GLOG_STATIC_DEFINE" "#if 1") +else() + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${PORT}/export.h" "#ifdef GLOG_STATIC_DEFINE" "#if 0") +endif() + +if("unwind" IN_LIST FEATURES) + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/glog/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/glog/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000..a7c80f0 --- /dev/null +++ b/vcpkg/ports/glog/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,6 @@ +set(GLOG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
+
+_find_package(${ARGS})
+
+set(CMAKE_MODULE_PATH ${GLOG_PREV_MODULE_PATH})
diff --git a/vcpkg/ports/glog/vcpkg.json b/vcpkg/ports/glog/vcpkg.json new file mode 100644 index 0000000..da170c2 --- /dev/null +++ b/vcpkg/ports/glog/vcpkg.json @@ -0,0 +1,30 @@ +{ + "name": "glog", + "version": "0.7.1", + "description": "C++ implementation of the Google logging module", + "homepage": "https://github.com/google/glog", + "license": "BSD-3-Clause", + "dependencies": [ + "gflags", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "customprefix": { + "description": "Enable support for user-generated message prefixes" + }, + "unwind": { + "description": "Enable libunwind support", + "supports": "linux", + "dependencies": [ + "libunwind" + ] + } + } +} |