diff --git a/.devcontainer b/.devcontainer new file mode 160000 index 0000000000..a5a7aaf969 --- /dev/null +++ b/.devcontainer @@ -0,0 +1 @@ +Subproject commit a5a7aaf969934f89b2db9f761f5df5b9bd5277b5 diff --git a/.github/release-tag.json b/.github/release-tag.json new file mode 100644 index 0000000000..534b446232 --- /dev/null +++ b/.github/release-tag.json @@ -0,0 +1,4 @@ +{ + "message": "xpro version 1.17.0.1 tag", + "tag": "xpv1.17.0.1" +} diff --git a/.github/workflows/coverity_scan.yml b/.github/workflows/coverity_scan.yml index 373504d002..5e5e6a31a4 100644 --- a/.github/workflows/coverity_scan.yml +++ b/.github/workflows/coverity_scan.yml @@ -1,6 +1,6 @@ name: coverity-linux -on: [push, pull_request] +on: [workflow_dispatch] permissions: contents: read diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a7a61dd371..bbec7a85ec 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,6 +1,6 @@ name: linux -on: [push, pull_request] +on: [workflow_dispatch] permissions: contents: read diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2d846f7f1a..72facfd906 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,6 @@ name: macos -on: [push, pull_request] +on: [workflow_dispatch] permissions: contents: read diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e3b547c89a..6a5dd35180 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,6 @@ name: windows -on: [push, pull_request] +on: [workflow_dispatch] permissions: contents: read diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml new file mode 100644 index 0000000000..2adea5633b --- /dev/null +++ b/.github/workflows/xpbuild.yml @@ -0,0 +1,28 @@ +name: xpBuild +permissions: + contents: read + pull-requests: write +on: + push: + tags: ["xpv*"] + pull_request: + branches: ["xpro"] + workflow_dispatch: +jobs: + linux: + permissions: + contents: read + pull-requests: write + packages: write + uses: externpro/externpro/.github/workflows/build-linux.yml@25.07.17 + secrets: + automation_token: ${{ secrets.GHCR_TOKEN }} + with: {} + macos: + uses: externpro/externpro/.github/workflows/build-macos.yml@25.07.17 + secrets: inherit + with: {} + windows: + uses: externpro/externpro/.github/workflows/build-windows.yml@25.07.17 + secrets: inherit + with: {} diff --git a/.github/workflows/xpinit.yml b/.github/workflows/xpinit.yml new file mode 100644 index 0000000000..4893a2bde4 --- /dev/null +++ b/.github/workflows/xpinit.yml @@ -0,0 +1,12 @@ +name: xpInit externpro +permissions: + contents: write + pull-requests: write + packages: write +on: + workflow_dispatch: +jobs: + init: + uses: externpro/externpro/.github/workflows/init-externpro.yml@main + secrets: + automation_token: ${{ secrets.XPRO_TOKEN }} diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml new file mode 100644 index 0000000000..1abc8cee22 --- /dev/null +++ b/.github/workflows/xprelease.yml @@ -0,0 +1,44 @@ +name: xpRelease +on: + workflow_dispatch: + inputs: + workflow_run_url: + description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)' + required: true + type: string + workflow_run: + workflows: ["xpBuild"] + types: [completed] +jobs: + dispatch-at-tag: + if: >- + github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' && + startsWith(github.event.workflow_run.head_branch, 'xpv') + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - + name: Dispatch xpRelease at tag + shell: bash + env: + GH_TOKEN: ${{ github.token }} + RUN_URL: ${{ github.event.workflow_run.html_url }} + TAG_REF: ${{ github.event.workflow_run.head_branch }} + run: | + set -euo pipefail + gh api -X POST "repos/${{ github.repository }}/actions/workflows/xprelease.yml/dispatches" \ + -f ref="$TAG_REF" \ + -f inputs[workflow_run_url]="$RUN_URL" + # Upload build artifacts as release assets + release-from-build: + if: github.event_name == 'workflow_dispatch' + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.07.17 + with: + workflow_run_url: ${{ github.event.inputs.workflow_run_url }} + permissions: + contents: write + id-token: write + attestations: write + secrets: inherit diff --git a/.github/workflows/xptag.yml b/.github/workflows/xptag.yml new file mode 100644 index 0000000000..fcf6e72f2c --- /dev/null +++ b/.github/workflows/xptag.yml @@ -0,0 +1,16 @@ +name: xpTag +permissions: + contents: write + issues: write +on: + pull_request: + types: [closed] +jobs: + tag: + if: ${{ github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'xpro' && contains(github.event.pull_request.labels.*.name, 'release:tag') }} + uses: externpro/externpro/.github/workflows/tag-release.yml@25.07.17 + with: + merge_sha: ${{ github.event.pull_request.merge_commit_sha }} + pr_number: ${{ github.event.pull_request.number }} + secrets: + automation_token: ${{ secrets.XPRO_TOKEN }} diff --git a/.github/workflows/xpupdate.yml b/.github/workflows/xpupdate.yml new file mode 100644 index 0000000000..0a51a0875c --- /dev/null +++ b/.github/workflows/xpupdate.yml @@ -0,0 +1,13 @@ +name: xpUpdate externpro +permissions: + contents: write + pull-requests: write + packages: write +on: + workflow_dispatch: +jobs: + update: + uses: externpro/externpro/.github/workflows/update-externpro.yml@main + secrets: + automation_token: ${{ secrets.XPRO_TOKEN }} + with: {} diff --git a/.gitignore b/.gitignore index 25f272c968..14e65c7b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,8 @@ cmake-build-*/ /.vs /out/build /CMakeSettings.json + +# externpro +.env +_bld*/ +docker-compose.override.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..18932abfb9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".devcontainer"] + path = .devcontainer + url = https://github.com/externpro/externpro diff --git a/CMakeLists.txt b/CMakeLists.txt index c7708eb92b..ba5b988496 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT) -cmake_minimum_required(VERSION 3.10...3.21) +cmake_minimum_required(VERSION 3.10...3.31) # --------------------------------------------------------------------------------------- # Start spdlog project @@ -10,6 +10,7 @@ include(cmake/ide.cmake) spdlog_extract_version() +set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) project(spdlog VERSION ${SPDLOG_VERSION} LANGUAGES CXX) message(STATUS "Build spdlog: ${SPDLOG_VERSION}") @@ -350,6 +351,17 @@ endif() # --------------------------------------------------------------------------------------- if(SPDLOG_INSTALL) message(STATUS "Generating install") + if(COMMAND xpExternPackage) + set(targetsFile "spdlogConfigTargets") + xpExternPackage(TARGETS_FILE ${targetsFile} LIBRARIES spdlog spdlog_header_only + BASE v${SPDLOG_VERSION} XPDIFF "patch" FIND_THREADS DEPS fmt + WEB "https://github.com/gabime/spdlog/wiki" UPSTREAM "github.com/gabime/spdlog" + DESC "Fast C++ logging library" + LICENSE "[MIT](https://github.com/gabime/spdlog?tab=License-1-ov-file 'MIT License')" + ) + set(config_targets_file "${targetsFile}.cmake") + set(export_dest_dir "${CMAKE_INSTALL_CMAKEDIR}") + else() set(project_config_in "${CMAKE_CURRENT_LIST_DIR}/cmake/spdlogConfig.cmake.in") set(project_config_out "${CMAKE_CURRENT_BINARY_DIR}/spdlogConfig.cmake") set(config_targets_file "spdlogConfigTargets.cmake") @@ -357,6 +369,7 @@ if(SPDLOG_INSTALL) set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/cmake/spdlog") set(pkgconfig_install_dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig") set(pkg_config "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc") + endif() # --------------------------------------------------------------------------------------- # Include files @@ -377,6 +390,7 @@ if(SPDLOG_INSTALL) # --------------------------------------------------------------------------------------- # Install pkg-config file # --------------------------------------------------------------------------------------- + if(NOT COMMAND xpExternPackage) if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") else() @@ -392,6 +406,7 @@ if(SPDLOG_INSTALL) string(CONCAT PKG_CONFIG_DEFINES "-D" "${PKG_CONFIG_DEFINES}") configure_file("cmake/${PROJECT_NAME}.pc.in" "${pkg_config}" @ONLY) install(FILES "${pkg_config}" DESTINATION "${pkgconfig_install_dir}") + endif() # --------------------------------------------------------------------------------------- # Install CMake config files @@ -400,14 +415,18 @@ if(SPDLOG_INSTALL) FILE "${CMAKE_CURRENT_BINARY_DIR}/${config_targets_file}") install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE spdlog:: FILE ${config_targets_file}) + if(NOT COMMAND xpExternPackage) include(CMakePackageConfigHelpers) configure_package_config_file("${project_config_in}" "${project_config_out}" INSTALL_DESTINATION ${export_dest_dir}) write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion) install(FILES "${project_config_out}" "${version_config_file}" DESTINATION "${export_dest_dir}") + endif() # --------------------------------------------------------------------------------------- # Support creation of installable packages # --------------------------------------------------------------------------------------- + if(NOT COMMAND xpExternPackage) include(cmake/spdlogCPack.cmake) + endif() endif() diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000000..28efa3978f --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,9 @@ +{ + "version": 8, + "include": [ + ".devcontainer/cmake/presets/xpLinuxNinja.json", + ".devcontainer/cmake/presets/xpDarwinNinja.json", + ".devcontainer/cmake/presets/xpMswVs2022.json", + ".devcontainer/cmake/presets/xpMswVs2026.json" + ] +} diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json new file mode 100644 index 0000000000..5a4198137f --- /dev/null +++ b/CMakePresetsBase.json @@ -0,0 +1,19 @@ +{ + "version": 8, + "configurePresets": [ + { + "name": "config-base", + "hidden": true, + "binaryDir": "${sourceDir}/_bld-${presetName}", + "cacheVariables": { + "SPDLOG_FMT_EXTERNAL": "ON" + } + } + ], + "buildPresets": [ + { + "name": "build-base", + "hidden": true + } + ] +} diff --git a/docker-compose.sh b/docker-compose.sh new file mode 120000 index 0000000000..85f182f0be --- /dev/null +++ b/docker-compose.sh @@ -0,0 +1 @@ +.devcontainer/compose.pro.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 120000 index 0000000000..46c1f8918f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1 @@ +.devcontainer/compose.bld.yml \ No newline at end of file diff --git a/xprodeps.md b/xprodeps.md new file mode 100644 index 0000000000..982f9381ba --- /dev/null +++ b/xprodeps.md @@ -0,0 +1,22 @@ +# spdlog dependencies + +|project|license [^_l]|description [dependencies]|version|source|diff [^_d]| +|-------|-------------|--------------------------|-------|------|----------| +|[spdlog](https://github.com/gabime/spdlog/wiki)|[MIT](https://github.com/gabime/spdlog?tab=License-1-ov-file 'MIT License')|Fast C++ logging library [deps: _fmt_]| |[upstream](https://github.com/gabime/spdlog 'github.com/gabime/spdlog')| [patch]| +|[fmt](https://fmt.dev/)|[MIT](https://github.com/fmtlib/fmt?tab=MIT-1-ov-file#readme 'MIT License')|A modern formatting library|[xpv12.1.0.1](https://github.com/externpro/fmt/releases/tag/xpv12.1.0.1 'release')|[repo](https://github.com/externpro/fmt 'github.com/externpro/fmt') [upstream](https://github.com/fmtlib/fmt 'github.com/fmtlib/fmt')|[diff](https://github.com/externpro/fmt/compare/12.1.0...xpv12.1.0.1 'github.com/externpro/fmt/compare/12.1.0...xpv12.1.0.1') [patch]| + +![deps](xprodeps.svg 'dependencies') + +Dependency version check: all 1 parent-manifest versions match pinned versions. + +|diff |description| +|------|-----------| +|patch |diff modifies/patches existing cmake| +|intro |diff introduces cmake| +|auto |diff adds cmake to replace autotools/configure/make| +|native|diff adds cmake but uses existing build system| +|bin |diff adds cmake to repackage binaries built elsewhere| +|fetch |diff adds cmake and utilizes FetchContent| + +[^_l]: see [SPDX License List](https://spdx.org/licenses/ '') for a list of commonly found licenses +[^_d]: see table above with description of diff diff --git a/xprodeps.svg b/xprodeps.svg new file mode 100644 index 0000000000..931253f229 --- /dev/null +++ b/xprodeps.svg @@ -0,0 +1,30 @@ + + + + + + +GG + + +spdlog + +spdlog + + + +fmt + +fmt + + + +spdlog->fmt + + + + +