Skip to content

Commit 96a2dd3

Browse files
committed
Formally set version and testing to C++ 11
1 parent 8224e42 commit 96a2dd3

5 files changed

Lines changed: 208 additions & 206 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# Static Debug
4242
- name: "Static Debug: Configure"
43-
run: cmake -G Ninja -S . -B build-static-dbg -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_DEBUG_POSTFIX=d${{matrix.static_postfix}}"
43+
run: cmake -G Ninja -S . -B build-static-dbg -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_DEBUG_POSTFIX=d${{matrix.static_postfix}}" -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
4444
- name: "Static Debug: Build"
4545
run: cmake --build build-static-dbg
4646
- name: "Static Debug: Test"
@@ -49,7 +49,7 @@ jobs:
4949

5050
# Shared Debug
5151
- name: "Shared Debug: Configure"
52-
run: cmake -G Ninja -S . -B build-shared-dbg -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEBUG_POSTFIX=d -DBUILD_SHARED_LIBS=ON
52+
run: cmake -G Ninja -S . -B build-shared-dbg -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEBUG_POSTFIX=d -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
5353
- name: "Shared Debug: Build"
5454
run: cmake --build build-shared-dbg
5555
- name: "Shared Debug: Test"
@@ -58,7 +58,7 @@ jobs:
5858

5959
# Static Release
6060
- name: "Static Release: Configure"
61-
run: cmake -G Ninja -S . -B build-static-rel -DCMAKE_BUILD_TYPE=Release "-DCMAKE_RELEASE_POSTFIX=${{matrix.static_postfix}}"
61+
run: cmake -G Ninja -S . -B build-static-rel -DCMAKE_BUILD_TYPE=Release "-DCMAKE_RELEASE_POSTFIX=${{matrix.static_postfix}}" -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
6262
- name: "Static Release: Build"
6363
run: cmake --build build-static-rel
6464
- name: "Static Release: Test"
@@ -67,7 +67,7 @@ jobs:
6767

6868
# Shared Release
6969
- name: "Shared Release: Configure"
70-
run: cmake -G Ninja -S . -B build-shared-rel -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
70+
run: cmake -G Ninja -S . -B build-shared-rel -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
7171
- name: "Shared Release: Build"
7272
run: cmake --build build-shared-rel
7373
- name: "Shared Release: Test"
@@ -89,23 +89,23 @@ jobs:
8989
run: >-
9090
ctest --build-and-test test test-static-dbg
9191
--build-generator Ninja
92-
--build-options -DCMAKE_BUILD_TYPE=Debug -Dtinyxml2_SHARED_LIBS=NO -DCMAKE_PREFIX_PATH=${{github.workspace}}/install
92+
--build-options -DCMAKE_BUILD_TYPE=Debug -Dtinyxml2_SHARED_LIBS=NO -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
9393
--test-command ctest --output-on-failure
9494
- name: "Test find_package: Static Release"
9595
run: >-
9696
ctest --build-and-test test test-static-rel
9797
--build-generator Ninja
98-
--build-options -DCMAKE_BUILD_TYPE=Release -Dtinyxml2_SHARED_LIBS=NO -DCMAKE_PREFIX_PATH=${{github.workspace}}/install
98+
--build-options -DCMAKE_BUILD_TYPE=Release -Dtinyxml2_SHARED_LIBS=NO -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
9999
--test-command ctest --output-on-failure
100100
- name: "Test find_package: Shared Debug"
101101
run: >-
102102
ctest --build-and-test test test-shared-dbg
103103
--build-generator Ninja
104-
--build-options -DCMAKE_BUILD_TYPE=Debug -Dtinyxml2_SHARED_LIBS=YES -DCMAKE_PREFIX_PATH=${{github.workspace}}/install
104+
--build-options -DCMAKE_BUILD_TYPE=Debug -Dtinyxml2_SHARED_LIBS=YES -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
105105
--test-command ctest --output-on-failure
106106
- name: "Test find_package: Shared Release"
107107
run: >-
108108
ctest --build-and-test test test-shared-rel
109109
--build-generator Ninja
110-
--build-options -DCMAKE_BUILD_TYPE=Release -Dtinyxml2_SHARED_LIBS=YES -DCMAKE_PREFIX_PATH=${{github.workspace}}/install
110+
--build-options -DCMAKE_BUILD_TYPE=Release -Dtinyxml2_SHARED_LIBS=YES -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON
111111
--test-command ctest --output-on-failure

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
2222
add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
2323
add_library(tinyxml2::tinyxml2 ALIAS tinyxml2)
2424

25-
# Uncomment the following line to require C++11 (or greater) to use tinyxml2
26-
# target_compile_features(tinyxml2 PUBLIC cxx_std_11)
25+
# Require C++11 (or greater) to use tinyxml2
26+
target_compile_features(tinyxml2 PUBLIC cxx_std_11)
2727
target_include_directories(tinyxml2 PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
2828

2929
target_compile_definitions(

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
TinyXML-2 is a simple, small, efficient, C++ XML parser that can be
66
easily integrated into other programs.
77

8+
It is written in C++ 11 and does not use any Standard Library (std::) features.
9+
810
The master is hosted on GitHub:
911
https://github.com/leethomason/tinyxml2
1012

0 commit comments

Comments
 (0)