diff --git a/ports/easyloggingpp/0001_add_cmake_options.patch b/ports/easyloggingpp/0001_add_cmake_options.patch new file mode 100644 index 0000000000..b20745f1d4 --- /dev/null +++ b/ports/easyloggingpp/0001_add_cmake_options.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 538cc8a..9221dab 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,6 +25,10 @@ option(test "Build all tests" OFF) + option(build_static_lib "Build easyloggingpp as a static library" OFF) + option(lib_utc_datetime "Build library with UTC date/time logging" OFF) + ++option(no_default_logfile "Do not write to default log file \"myeasylog.log\" (define ELPP_NO_DEFAULT_LOG_FILE)" OFF) ++option(thread_safe "Build easyloggingpp thread safe (define ELPP_THREAD_SAFE)" OFF) ++option(use_std_threads "Use standard library thread synchronization (define ELPP_FORCE_USE_STD_THREAD)" OFF) ++ + set(ELPP_MAJOR_VERSION "9") + set(ELPP_MINOR_VERSION "96") + set(ELPP_PATCH_VERSION "7") +@@ -57,6 +61,18 @@ if (build_static_lib) + add_definitions(-DELPP_UTC_DATETIME) + endif() + ++ if (no_default_logfile) ++ add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) ++ endif() ++ ++ if (thread_safe) ++ add_definitions(-DELPP_THREAD_SAFE) ++ endif() ++ ++ if (use_std_threads) ++ add_definitions(-DELPP_FORCE_USE_STD_THREAD) ++ endif() ++ + require_cpp11() + add_library(easyloggingpp STATIC src/easylogging++.cc) + set_property(TARGET easyloggingpp PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/ports/easyloggingpp/portfile.cmake b/ports/easyloggingpp/portfile.cmake index 22f8b5ab9f..1e84b37248 100644 --- a/ports/easyloggingpp/portfile.cmake +++ b/ports/easyloggingpp/portfile.cmake @@ -6,11 +6,21 @@ vcpkg_from_github( REF v9.97.0 SHA512 e45789edaf7a43ad6a73861840d24ccce9b9d6bba1aaacf93c6ac26ff7449957251d2ca322c9da85130b893332dd305b13a2499eaffc65ecfaaafa3e11f8d63d HEAD_REF master + PATCHES + 0001_add_cmake_options.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + std-locking use_std_threads + thread-safe thread_safe + no-defaultfile no_default_logfile ) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + ${FEATURE_OPTIONS} -Dbuild_static_lib=ON ) vcpkg_cmake_install() diff --git a/ports/easyloggingpp/vcpkg.json b/ports/easyloggingpp/vcpkg.json index 8a5e5bbe1d..4ebffddaf3 100644 --- a/ports/easyloggingpp/vcpkg.json +++ b/ports/easyloggingpp/vcpkg.json @@ -1,7 +1,7 @@ { "name": "easyloggingpp", "version": "9.97.0", - "port-version": 2, + "port-version": 3, "description": "Easylogging++ is a single header efficient logging library for C++ applications.", "homepage": "https://github.com/amrayn/easyloggingpp", "dependencies": [ @@ -13,5 +13,16 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "features": { + "no-defaultfile": { + "description": "Do not write to default log file \"myeasylog.log\" (compile with ELPP_NO_DEFAULT_LOG_FILE)" + }, + "std-locking": { + "description": "Use std::mutex for thread synchronization (compile with ELPP_FORCE_USE_STD_THREAD)" + }, + "thread-safe": { + "description": "Make easyloggingpp thread safe (compile with ELPP_THREAD_SAFE)" + } + } } diff --git a/versions/baseline.json b/versions/baseline.json index 08e0ff5dc3..c9189bb17a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2234,7 +2234,7 @@ }, "easyloggingpp": { "baseline": "9.97.0", - "port-version": 2 + "port-version": 3 }, "eathread": { "baseline": "1.32.09", diff --git a/versions/e-/easyloggingpp.json b/versions/e-/easyloggingpp.json index a6e90e0aa8..5352093985 100644 --- a/versions/e-/easyloggingpp.json +++ b/versions/e-/easyloggingpp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "69f6b238899967e671f818a164f21de0219546bc", + "version": "9.97.0", + "port-version": 3 + }, { "git-tree": "40ca985ab8030ca0daf7c902e413423801d3e3d4", "version": "9.97.0",