From acf975cab1c5ef008ff1977809cec817e10b40f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 19 Jan 2020 15:30:38 +0100 Subject: [PATCH] Separate version macros to its own header --- src/CMakeLists.txt | 1 + src/catch2/catch.hpp | 4 +--- src/catch2/catch_version_macros.hpp | 13 +++++++++++++ tools/scripts/releaseCommon.py | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/catch2/catch_version_macros.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e37c3b9..ac983f02 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -115,6 +115,7 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/catch_uncaught_exceptions.h ${SOURCES_DIR}/catch_user_interfaces.h ${SOURCES_DIR}/catch_version.h + ${SOURCES_DIR}/catch_version_macros.hpp ${SOURCES_DIR}/catch_wildcard_pattern.h ${SOURCES_DIR}/catch_windows_h_proxy.h ${SOURCES_DIR}/catch_xmlwriter.h diff --git a/src/catch2/catch.hpp b/src/catch2/catch.hpp index 5e3ea8fb..1c6fbdc1 100644 --- a/src/catch2/catch.hpp +++ b/src/catch2/catch.hpp @@ -9,9 +9,7 @@ #ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED #define TWOBLUECUBES_CATCH_HPP_INCLUDED -#define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 10 -#define CATCH_VERSION_PATCH 2 +#include #ifdef __clang__ # pragma clang system_header diff --git a/src/catch2/catch_version_macros.hpp b/src/catch2/catch_version_macros.hpp new file mode 100644 index 00000000..db48b00a --- /dev/null +++ b/src/catch2/catch_version_macros.hpp @@ -0,0 +1,13 @@ +/* + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef TWOBLUECUBES_CATCH_VERSION_MACROS_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_VERSION_MACROS_HPP_INCLUDED + +#define CATCH_VERSION_MAJOR 2 +#define CATCH_VERSION_MINOR 10 +#define CATCH_VERSION_PATCH 2 + +#endif // TWOBLUECUBES_CATCH_VERSION_MACROS_HPP_INCLUDED diff --git a/tools/scripts/releaseCommon.py b/tools/scripts/releaseCommon.py index 8472f22e..6226bdc0 100644 --- a/tools/scripts/releaseCommon.py +++ b/tools/scripts/releaseCommon.py @@ -12,7 +12,7 @@ from scriptCommon import catchPath versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' ) rootPath = os.path.join( catchPath, 'src/catch2' ) versionPath = os.path.join( rootPath, "catch_version.cpp" ) -definePath = os.path.join(rootPath, 'catch.hpp') +definePath = os.path.join(rootPath, 'catch_version_macros.hpp') readmePath = os.path.join( catchPath, "README.md" ) cmakePath = os.path.join(catchPath, 'CMakeLists.txt')