Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
test/googletest-1.13.0
test/googletest-1.16.0
2 changes: 1 addition & 1 deletion .codedocs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ EXAMPLE_PATH =

# One or more directories and files to exclude from documentation generation.
# Use relative paths with respect to the repository root directory.
EXCLUDE = test/googletest-1.13.0/
EXCLUDE = test/googletest-1.16.0/

# One or more wildcard patterns to exclude files and directories from document
# generation.
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/quick_cmake/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Quick CMake config
description: "Runs CMake 3.14+ (if already setup)"
inputs:
args:
description: "Other arguments"
required: false
default: ""
cmake-version:
description: "The CMake version to run"
required: true

runs:
using: composite
steps:
- name: CMake ${{ inputs.cmake-version }}
uses: jwlawson/actions-setup-cmake@v2.2
with:
cmake-version: "${{ inputs.cmake-version }}"
- run: |
mkdir -p build-tmp
touch build-tmp/tmp
rm -r build-tmp/*
(cd build-tmp && cmake .. ${{ inputs.args }})
rm -r build-tmp
shell: bash
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ jobs:
--config ${{ env.CMAKE_BUILD_TYPE }} \
--verbose

cmake-config-oldest-cmake:
name: CMake version range config check (Ubuntu 24.04)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6

- name: Check CMake 3.15
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.15"
if: success() || failure()

- name: Check CMake 4.3
uses: ./.github/actions/quick_cmake
with:
cmake-version: "4.3"
if: success() || failure()

bazel-build:
strategy:
matrix:
Expand Down
28 changes: 3 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# 3.5 is actually available almost everywhere.
# 3.30 as the upper policy limit avoids CMake deprecation warnings.
cmake_minimum_required(VERSION 3.5...3.30)

# enable MSVC_RUNTIME_LIBRARY target property
# see https://cmake.org/cmake/help/latest/policy/CMP0091.html
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
cmake_minimum_required(VERSION 3.15..4.3)

project(YAML_CPP VERSION 0.9.0 LANGUAGES CXX)

Expand Down Expand Up @@ -62,15 +54,8 @@ if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
MultiThreaded$<$<CONFIG:Debug>:Debug>$<${msvc-shared_rt}:DLL>)
endif()

set(contrib-pattern "src/contrib/*.cpp")
set(src-pattern "src/*.cpp")
if (CMAKE_VERSION VERSION_GREATER 3.12)
list(INSERT contrib-pattern 0 CONFIGURE_DEPENDS)
list(INSERT src-pattern 0 CONFIGURE_DEPENDS)
endif()

file(GLOB yaml-cpp-contrib-sources ${contrib-pattern})
file(GLOB yaml-cpp-sources ${src-pattern})
file(GLOB yaml-cpp-contrib-sources CONFIGURE_DEPENDS "src/contrib/*.cpp")
file(GLOB yaml-cpp-sources CONFIGURE_DEPENDS "src/*.cpp")

set(msvc-rt $<TARGET_PROPERTY:MSVC_RUNTIME_LIBRARY>)

Expand All @@ -80,8 +65,6 @@ set(msvc-rt-mt-static $<STREQUAL:${msvc-rt},MultiThreaded>)
set(msvc-rt-mtd-dll $<STREQUAL:${msvc-rt},MultiThreadedDebugDLL>)
set(msvc-rt-mt-dll $<STREQUAL:${msvc-rt},MultiThreadedDLL>)

set(backport-msvc-runtime $<VERSION_LESS:${CMAKE_VERSION},3.15>)

add_library(yaml-cpp ${yaml-cpp-type} "")
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)

Expand Down Expand Up @@ -118,11 +101,6 @@ endif()

target_compile_options(yaml-cpp
PRIVATE
$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-static}>:-MTd>
$<$<AND:${backport-msvc-runtime},${msvc-rt-mt-static}>:-MT>
$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-dll}>:-MDd>
$<$<AND:${backport-msvc-runtime},${msvc-rt-mt-dll}>:-MD>

# /wd4127 = disable warning C4127 "conditional expression is constant"
# http://msdn.microsoft.com/en-us/library/6t66728h.aspx
# /wd4355 = disable warning C4355 "'this' : used in base member initializer list
Expand Down
15 changes: 4 additions & 11 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,13 @@ if(YAML_USE_SYSTEM_GTEST)
endif()
else()
add_subdirectory(
"${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.13.0"
"${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.16.0"
"${CMAKE_CURRENT_BINARY_DIR}/prefix")
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.13.0/googletest/include")
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.16.0/googletest/include")
endif()

set(test-new-api-pattern "new-api/*.cpp")
set(test-source-pattern "*.cpp" "integration/*.cpp" "node/*.cpp")
if (CMAKE_VERSION VERSION_GREATER 3.11)
list(INSERT test-new-api-pattern 0 CONFIGURE_DEPENDS)
list(INSERT test-source-pattern 0 CONFIGURE_DEPENDS)
endif()

file(GLOB test-new-api-sources ${test-new-api-pattern})
file(GLOB test-sources ${test-source-pattern})
file(GLOB test-new-api-sources CONFIGURE_DEPENDS "new-api/*.cpp")
file(GLOB test-sources CONFIGURE_DEPENDS "*.cpp" "integration/*.cpp" "node/*.cpp")

add_executable(yaml-cpp-tests "")
target_sources(yaml-cpp-tests
Expand Down
53 changes: 0 additions & 53 deletions test/googletest-1.13.0/.github/ISSUE_TEMPLATE/00-bug_report.yml

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions test/googletest-1.13.0/.github/ISSUE_TEMPLATE/config.yml

This file was deleted.

43 changes: 0 additions & 43 deletions test/googletest-1.13.0/.github/workflows/gtest-ci.yml

This file was deleted.

40 changes: 0 additions & 40 deletions test/googletest-1.13.0/WORKSPACE

This file was deleted.

35 changes: 0 additions & 35 deletions test/googletest-1.13.0/docs/platforms.md

This file was deleted.

Loading
Loading