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
26 changes: 3 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# 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.0)

project(YAML_CPP VERSION 0.8.0 LANGUAGES CXX)

Expand Down Expand Up @@ -61,15 +55,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 @@ -79,8 +66,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 @@ -117,11 +102,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
2 changes: 2 additions & 0 deletions test/fptostring_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <iomanip>

#include "yaml-cpp/fptostring.h"
#include "gtest/gtest.h"

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