From 648a23cce2bd5ecd09044788fb1775ee725c63df Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Fri, 12 Sep 2025 08:55:26 +0300 Subject: [PATCH 1/9] Add CMake packaging, tests, and CI --- .github/workflows/ci.yml | 83 ++++++++++++++ CMakeLists.txt | 105 +++++++++--------- cmake/log-it-cppConfig.cmake.in | 6 + examples/CMakeLists.txt | 6 + tests/CMakeLists.txt | 7 ++ tests/file_logger_test.cpp | 18 +++ tests/install_consumer/CMakeLists.txt | 7 ++ tests/install_consumer/main.cpp | 9 ++ vcpkg-overlay/ports/log-it-cpp/portfile.cmake | 14 +++ vcpkg-overlay/ports/log-it-cpp/vcpkg.json | 11 ++ 10 files changed, 213 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 cmake/log-it-cppConfig.cmake.in create mode 100644 examples/CMakeLists.txt create mode 100644 tests/CMakeLists.txt create mode 100644 tests/file_logger_test.cpp create mode 100644 tests/install_consumer/CMakeLists.txt create mode 100644 tests/install_consumer/main.cpp create mode 100644 vcpkg-overlay/ports/log-it-cpp/portfile.cmake create mode 100644 vcpkg-overlay/ports/log-it-cpp/vcpkg.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cbf9a4a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,83 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + linux: + runs-on: ubuntu-latest + strategy: + matrix: + std: [11, 17] + steps: + - uses: actions/checkout@v4 + - name: Configure + run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build --prefix install + - name: Test + run: ctest --test-dir build + - name: Configure consumer project + run: cmake -S tests/install_consumer -B build-consumer -DCMAKE_PREFIX_PATH=${{ github.workspace }}/install -DCMAKE_CXX_STANDARD=${{ matrix.std }} + - name: Build consumer project + run: cmake --build build-consumer + + windows: + runs-on: windows-latest + strategy: + matrix: + std: [11, 17] + steps: + - uses: actions/checkout@v4 + - name: Configure + run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} + - name: Build + run: cmake --build build --config Release + - name: Install + run: cmake --install build --prefix install --config Release + - name: Test + run: ctest --test-dir build -C Release + - name: Configure consumer project + run: cmake -S tests/install_consumer -B build-consumer -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install" -DCMAKE_CXX_STANDARD=${{ matrix.std }} + - name: Build consumer project + run: cmake --build build-consumer --config Release + + macos: + runs-on: macos-latest + strategy: + matrix: + std: [11, 17] + steps: + - uses: actions/checkout@v4 + - name: Configure + run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build --prefix install + - name: Test + run: ctest --test-dir build + - name: Configure consumer project + run: cmake -S tests/install_consumer -B build-consumer -DCMAKE_PREFIX_PATH=${{ github.workspace }}/install -DCMAKE_CXX_STANDARD=${{ matrix.std }} + - name: Build consumer project + run: cmake --build build-consumer + + vcpkg-install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git + ./vcpkg/bootstrap-vcpkg.sh -disableMetrics + - name: Validate port + run: ./vcpkg/vcpkg install log-it-cpp --overlay-ports=vcpkg-overlay/ports + - name: Configure consumer project + run: cmake -B build -S tests/install_consumer -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake + - name: Build consumer project + run: cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c5412..ed53776 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,71 +1,70 @@ -# When generating a Code::Blocks project with MinGW, you can use: -# cmake -G "CodeBlocks - MinGW Makefiles" -S . -B build-cb cmake_minimum_required(VERSION 3.18) -project(time_shield LANGUAGES CXX) +project(log-it-cpp VERSION 1.0.0 LANGUAGES CXX) -if(MINGW OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(COMMON_WARN_FLAGS -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow) -endif() - -if(MSVC) - set(COMMON_WARN_FLAGS /W4 /wd4996) -endif() +option(LOG_IT_CPP_BUILD_TESTS "Build log-it-cpp tests" ${PROJECT_IS_TOP_LEVEL}) +option(LOG_IT_CPP_BUILD_EXAMPLES "Build log-it-cpp examples" OFF) if(NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 11) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Absolute path to the project root (where CMakeLists.txt resides) -get_filename_component(PROJECT_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) +# Dependency: TimeShield +find_package(TimeShield 1.0.3 QUIET CONFIG) +if(NOT TimeShield_FOUND) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libs/time-shield-cpp/CMakeLists.txt") + add_subdirectory(libs/time-shield-cpp) + else() + message(FATAL_ERROR "TimeShield not found. Please install it or add as submodule.") + endif() +endif() -# Define the LOGIT_BASE_PATH macro -add_compile_definitions(LOGIT_BASE_PATH="${PROJECT_ROOT}") +add_library(log-it-cpp INTERFACE) -# Include and library paths -set(PROJECT_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include/logit_cpp - ${CMAKE_CURRENT_SOURCE_DIR}/libs/fmt/include - ${CMAKE_CURRENT_SOURCE_DIR}/libs/time-shield-cpp/include/time_shield_cpp -) +add_compile_definitions(LOGIT_BASE_PATH="$") -# Header files from include/ -file(GLOB_RECURSE PROJECT_HEADERS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - include/*.hpp +target_include_directories(log-it-cpp INTERFACE + $ + $ ) -# Create a virtual target for headers so IDEs show them -add_custom_target(project_headers SOURCES ${PROJECT_HEADERS}) +target_link_libraries(log-it-cpp INTERFACE time_shield::time_shield) -# Locate all .cpp files in examples/ -file(GLOB EXAMPLES_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} examples/*.cpp) +if(LOG_IT_CPP_BUILD_TESTS) + enable_testing() + add_subdirectory(tests) +endif() -# Create a separate target for each example -foreach(example_src ${EXAMPLES_SOURCES}) - get_filename_component(example_name ${example_src} NAME_WE) +if(LOG_IT_CPP_BUILD_EXAMPLES) + add_subdirectory(examples) +endif() - add_executable(${example_name} ${example_src}) +include(CMakePackageConfigHelpers) - target_include_directories(${example_name} PRIVATE ${PROJECT_INCLUDE_DIRS}) - - if(COMMON_WARN_FLAGS) - target_compile_options(${example_name} PRIVATE ${COMMON_WARN_FLAGS}) - endif() +install(DIRECTORY include/ DESTINATION include) - target_link_directories(${example_name} PRIVATE ${PROJECT_LIBRARY_DIRS}) - target_compile_definitions(${example_name} PRIVATE ${PROJECT_DEFINES}) - target_link_libraries(${example_name} PRIVATE ${PROJECT_LIBS}) - - # Add headers as SOURCES so IDEs display them - set_source_files_properties(${PROJECT_HEADERS} PROPERTIES HEADER_FILE_ONLY ON) - target_sources(${example_name} PRIVATE ${PROJECT_HEADERS}) - - foreach(dll ${DLL_FILES}) - add_custom_command(TARGET ${example_name} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${dll}" - "$" - ) - endforeach() -endforeach() +install(TARGETS log-it-cpp EXPORT log-it-cppTargets) + +install(EXPORT log-it-cppTargets + FILE log-it-cppTargets.cmake + NAMESPACE log-it-cpp:: + DESTINATION lib/cmake/log-it-cpp +) + +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/log-it-cppConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +configure_package_config_file( + cmake/log-it-cppConfig.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/log-it-cppConfig.cmake" + INSTALL_DESTINATION lib/cmake/log-it-cpp +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/log-it-cppConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/log-it-cppConfigVersion.cmake" + DESTINATION lib/cmake/log-it-cpp +) diff --git a/cmake/log-it-cppConfig.cmake.in b/cmake/log-it-cppConfig.cmake.in new file mode 100644 index 0000000..b4190ca --- /dev/null +++ b/cmake/log-it-cppConfig.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(TimeShield) + +include("${CMAKE_CURRENT_LIST_DIR}/log-it-cppTargets.cmake") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..89facfe --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,6 @@ +file(GLOB EXAMPLES_SOURCES *.cpp) +foreach(example_src ${EXAMPLES_SOURCES}) + get_filename_component(example_name ${example_src} NAME_WE) + add_executable(${example_name} ${example_src}) + target_link_libraries(${example_name} PRIVATE log-it-cpp) +endforeach() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..fe9a0a6 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,7 @@ +file(GLOB TEST_SOURCES *.cpp) +foreach(test_src ${TEST_SOURCES}) + get_filename_component(test_name ${test_src} NAME_WE) + add_executable(${test_name} ${test_src}) + target_link_libraries(${test_name} PRIVATE log-it-cpp) + add_test(NAME ${test_name} COMMAND ${test_name}) +endforeach() diff --git a/tests/file_logger_test.cpp b/tests/file_logger_test.cpp new file mode 100644 index 0000000..38ad167 --- /dev/null +++ b/tests/file_logger_test.cpp @@ -0,0 +1,18 @@ +#define LOGIT_FILE_LOGGER_PATH "." +#include +#include +#include +#include + +int main() { + LOGIT_ADD_FILE_LOGGER_DEFAULT(); + const std::string message = "test log message"; + LOGIT_INFO(message); + LOGIT_WAIT(); + const auto date_ts = time_shield::start_of_day(time_shield::ms_to_sec(time_shield::ts_ms())); + const std::string filename = time_shield::to_iso8601_date(date_ts) + ".log"; + std::ifstream in(filename); + std::string line; + std::getline(in, line); + return line.find(message) != std::string::npos ? 0 : 1; +} diff --git a/tests/install_consumer/CMakeLists.txt b/tests/install_consumer/CMakeLists.txt new file mode 100644 index 0000000..a27006f --- /dev/null +++ b/tests/install_consumer/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.18) +project(install_consumer LANGUAGES CXX) + +find_package(log-it-cpp CONFIG REQUIRED) + +add_executable(install_consumer main.cpp) +target_link_libraries(install_consumer PRIVATE log-it-cpp::log-it-cpp) diff --git a/tests/install_consumer/main.cpp b/tests/install_consumer/main.cpp new file mode 100644 index 0000000..b604ffa --- /dev/null +++ b/tests/install_consumer/main.cpp @@ -0,0 +1,9 @@ +#define LOGIT_SHORT_NAME +#include + +int main() { + LOGIT_ADD_CONSOLE_DEFAULT(); + LOG_INFO("consumer works"); + LOGIT_WAIT(); + return 0; +} diff --git a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake new file mode 100644 index 0000000..5f8a863 --- /dev/null +++ b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake @@ -0,0 +1,14 @@ +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/../../.." + OPTIONS -DLOG_IT_CPP_BUILD_TESTS=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup( + CONFIG_PATH lib/cmake/log-it-cpp +) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib") + +vcpkg_install_copyright(FILE_LIST "${CURRENT_PORT_DIR}/../../../LICENSE") diff --git a/vcpkg-overlay/ports/log-it-cpp/vcpkg.json b/vcpkg-overlay/ports/log-it-cpp/vcpkg.json new file mode 100644 index 0000000..a38ab21 --- /dev/null +++ b/vcpkg-overlay/ports/log-it-cpp/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "log-it-cpp", + "version-string": "1.0.0", + "description": "LogIt++ logging library", + "homepage": "https://github.com/NewYaroslav/log-it-cpp", + "dependencies": [ + "vcpkg-cmake", + "vcpkg-cmake-config", + "time-shield-cpp" + ] +} From 21f69b7c16d78733575d1c67f91ef3352a3bd5d9 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Fri, 12 Sep 2025 09:02:51 +0300 Subject: [PATCH 2/9] chore(ci): fetch submodules --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbf9a4a..c21e724 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ jobs: std: [11, 17] steps: - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive - name: Configure run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} - name: Build @@ -34,6 +37,9 @@ jobs: std: [11, 17] steps: - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive - name: Configure run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} - name: Build @@ -54,6 +60,9 @@ jobs: std: [11, 17] steps: - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive - name: Configure run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} - name: Build @@ -71,6 +80,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive - name: Install vcpkg run: | git clone https://github.com/microsoft/vcpkg.git From 654fe50947666f6888fd25c1469c4777eb8f3bfb Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Fri, 12 Sep 2025 09:13:10 +0300 Subject: [PATCH 3/9] Handle macOS executable path --- include/logit_cpp/logit/utils/path_utils.hpp | 28 +++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/include/logit_cpp/logit/utils/path_utils.hpp b/include/logit_cpp/logit/utils/path_utils.hpp index 8a9afc3..a9b2726 100644 --- a/include/logit_cpp/logit/utils/path_utils.hpp +++ b/include/logit_cpp/logit/utils/path_utils.hpp @@ -19,8 +19,17 @@ #include #include #include +#elif defined(__APPLE__) +// For macOS systems +#include +#include +#include +#include +#include +#include +#include #else -// For POSIX systems +// For other POSIX systems #include #include #include @@ -95,6 +104,23 @@ namespace logit { // Convert from std::wstring (UTF-16) to std::string (UTF-8) std::wstring_convert> converter; return converter.to_bytes(exe_path); +# elif defined(__APPLE__) + uint32_t size = 0; + _NSGetExecutablePath(nullptr, &size); + std::string path(size, '\0'); + if (_NSGetExecutablePath(path.data(), &size) != 0) { + throw std::runtime_error("Failed to get executable path."); + } + char resolved[PATH_MAX]; + if (realpath(path.c_str(), resolved) == nullptr) { + throw std::runtime_error("Failed to resolve executable path."); + } + std::string exe_path(resolved); + size_t pos = exe_path.find_last_of("\\/"); + if (pos != std::string::npos) { + exe_path = exe_path.substr(0, pos); + } + return exe_path; # else char result[PATH_MAX]; ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); From ee0d1424c11521d1d0b06f8f97c7cf60050cfeaf Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Fri, 12 Sep 2025 09:30:44 +0300 Subject: [PATCH 4/9] fix: use mutable buffer for mac exec path --- include/logit_cpp/logit/utils/path_utils.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/logit_cpp/logit/utils/path_utils.hpp b/include/logit_cpp/logit/utils/path_utils.hpp index a9b2726..5d1881d 100644 --- a/include/logit_cpp/logit/utils/path_utils.hpp +++ b/include/logit_cpp/logit/utils/path_utils.hpp @@ -107,15 +107,16 @@ namespace logit { # elif defined(__APPLE__) uint32_t size = 0; _NSGetExecutablePath(nullptr, &size); - std::string path(size, '\0'); + std::vector path(size); if (_NSGetExecutablePath(path.data(), &size) != 0) { throw std::runtime_error("Failed to get executable path."); } + std::string exe_path(path.data()); char resolved[PATH_MAX]; - if (realpath(path.c_str(), resolved) == nullptr) { + if (realpath(exe_path.c_str(), resolved) == nullptr) { throw std::runtime_error("Failed to resolve executable path."); } - std::string exe_path(resolved); + exe_path = resolved; size_t pos = exe_path.find_last_of("\\/"); if (pos != std::string::npos) { exe_path = exe_path.substr(0, pos); From 5f3a8bbf160a53af500a93a06aed654c5b9af797 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Fri, 12 Sep 2025 09:50:39 +0300 Subject: [PATCH 5/9] test: read log file via logger path --- tests/file_logger_test.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/file_logger_test.cpp b/tests/file_logger_test.cpp index 38ad167..15b222f 100644 --- a/tests/file_logger_test.cpp +++ b/tests/file_logger_test.cpp @@ -1,6 +1,5 @@ #define LOGIT_FILE_LOGGER_PATH "." #include -#include #include #include @@ -9,9 +8,8 @@ int main() { const std::string message = "test log message"; LOGIT_INFO(message); LOGIT_WAIT(); - const auto date_ts = time_shield::start_of_day(time_shield::ms_to_sec(time_shield::ts_ms())); - const std::string filename = time_shield::to_iso8601_date(date_ts) + ".log"; - std::ifstream in(filename); + const std::string log_path = LOGIT_GET_LAST_FILE_PATH(0); + std::ifstream in(log_path); std::string line; std::getline(in, line); return line.find(message) != std::string::npos ? 0 : 1; From cca0c10204306e577901a93ed379a938c8a61cea Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Sat, 13 Sep 2025 03:32:54 +0300 Subject: [PATCH 6/9] ci: include TimeShield overlay in vcpkg step --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c21e724..23c6b5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,7 +88,9 @@ jobs: git clone https://github.com/microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.sh -disableMetrics - name: Validate port - run: ./vcpkg/vcpkg install log-it-cpp --overlay-ports=vcpkg-overlay/ports + run: ./vcpkg/vcpkg install log-it-cpp \ + --overlay-ports=vcpkg-overlay/ports \ + --overlay-ports=libs/time-shield-cpp/vcpkg-overlay/ports - name: Configure consumer project run: cmake -B build -S tests/install_consumer -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build consumer project From 02f64a1d6419e869af5a9f09dea4191769a23924 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Sat, 13 Sep 2025 04:47:38 +0300 Subject: [PATCH 7/9] Use pinned GitHub sources in vcpkg port --- .gitattributes | 3 +++ .github/workflows/ci.yml | 7 +++--- vcpkg-overlay/ports/log-it-cpp/portfile.cmake | 22 +++++++++++++++---- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..631303f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Не включать эти папки в GitHub source archive (tar.gz/zip) +vcpkg-overlay/ export-ignore +.github/ export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23c6b5a..0d4d703 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,9 +88,10 @@ jobs: git clone https://github.com/microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.sh -disableMetrics - name: Validate port - run: ./vcpkg/vcpkg install log-it-cpp \ - --overlay-ports=vcpkg-overlay/ports \ - --overlay-ports=libs/time-shield-cpp/vcpkg-overlay/ports + run: | + ./vcpkg/vcpkg install log-it-cpp \ + --overlay-ports=vcpkg-overlay/ports \ + --overlay-ports=libs/time-shield-cpp/vcpkg-overlay/ports - name: Configure consumer project run: cmake -B build -S tests/install_consumer -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build consumer project diff --git a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake index 5f8a863..c258d37 100644 --- a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake +++ b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake @@ -1,14 +1,28 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO NewYaroslav/log-it-cpp + REF b1bceedddf34b417eb8b81de3508fe9c9704a46a + SHA512 f3781cbb4e9e190df38c3fe7fa80ba69bf6f9dbafb158e0426dd4604f2f1ba794450679005a38d0f9f1dad0696e2f22b8b086b2d7d08a0f99bb4fd3b0f7ed5d8 + HEAD_REF main +) + vcpkg_cmake_configure( - SOURCE_PATH "${CURRENT_PORT_DIR}/../../.." - OPTIONS -DLOG_IT_CPP_BUILD_TESTS=OFF + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DLOG_IT_CPP_BUILD_TESTS=OFF ) vcpkg_cmake_install() vcpkg_cmake_config_fixup( + PACKAGE_NAME log-it-cpp CONFIG_PATH lib/cmake/log-it-cpp ) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") -vcpkg_install_copyright(FILE_LIST "${CURRENT_PORT_DIR}/../../../LICENSE") +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/lib" + "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}" +) From e0dca9c822aa620f73e243d3396eb1185d84a98f Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Sat, 13 Sep 2025 05:49:26 +0300 Subject: [PATCH 8/9] chore: pin vcpkg port to current commit --- vcpkg-overlay/ports/log-it-cpp/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake index c258d37..b4466f2 100644 --- a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake +++ b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO NewYaroslav/log-it-cpp - REF b1bceedddf34b417eb8b81de3508fe9c9704a46a - SHA512 f3781cbb4e9e190df38c3fe7fa80ba69bf6f9dbafb158e0426dd4604f2f1ba794450679005a38d0f9f1dad0696e2f22b8b086b2d7d08a0f99bb4fd3b0f7ed5d8 + REF 6ae5c3c0c84422695ade31c25191af812474ee93 + SHA512 9045037107c54b3bf9a9f1c9e24968a827dbb77c0fd82c22aa5bfb5ca43ff3b533a51a5ca4f3a435db5df9ebfe58e00c2d5dd9f11aa3f61a0e3d0191ae0eb604 HEAD_REF main ) From 02ef4e9019da47be84ce3cedb50c0810792a8e24 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Sat, 13 Sep 2025 06:47:14 +0300 Subject: [PATCH 9/9] chore(vcpkg): pin log-it-cpp port to a5ef55f --- vcpkg-overlay/ports/log-it-cpp/portfile.cmake | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake index b4466f2..a6e80af 100644 --- a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake +++ b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake @@ -1,23 +1,19 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO NewYaroslav/log-it-cpp - REF 6ae5c3c0c84422695ade31c25191af812474ee93 - SHA512 9045037107c54b3bf9a9f1c9e24968a827dbb77c0fd82c22aa5bfb5ca43ff3b533a51a5ca4f3a435db5df9ebfe58e00c2d5dd9f11aa3f61a0e3d0191ae0eb604 + REF a5ef55f060f720063bbbb5c9dfdb57086d618e96 + SHA512 1a5a418fcae653ab9731068a21c17a56577f98162d2c292418f60d2722ef3075c83f065c4b6115979dd1f38dd54d50f2ecb635ac0049cafd3cfc2a33aa708fff HEAD_REF main ) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DLOG_IT_CPP_BUILD_TESTS=OFF + OPTIONS -DLOG_IT_CPP_BUILD_TESTS=OFF ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup( - PACKAGE_NAME log-it-cpp - CONFIG_PATH lib/cmake/log-it-cpp -) +vcpkg_cmake_config_fixup(PACKAGE_NAME log-it-cpp CONFIG_PATH lib/cmake/log-it-cpp) vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")