From aa63f840f83d418d738ada2fb3667f7a54713404 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Sun, 11 Apr 2021 19:13:08 -0700 Subject: [PATCH] Add version directive --- .gitignore | 1 + CMakeLists.txt | 7 ++++++- include/rexy/algorithm.hpp | 1 + include/rexy/allocator.hpp | 2 ++ include/rexy/basic_string_hash.hpp | 2 ++ include/rexy/binary.hpp | 1 + include/rexy/binary_base.hpp | 1 + include/rexy/expression.hpp | 2 ++ include/rexy/filerd.hpp | 4 +++- include/rexy/hash.hpp | 1 + include/rexy/meta.hpp | 2 ++ include/rexy/mpmc_queue.hpp | 2 ++ include/rexy/rexy.hpp.in | 24 ++++++++++++++++++++++++ include/rexy/static_string_hash.hpp | 1 + include/rexy/steal.hpp | 3 ++- include/rexy/string.hpp | 1 + include/rexy/string_base.hpp | 1 + include/rexy/string_hash.hpp | 1 + include/rexy/threadpool.hpp | 2 ++ include/rexy/traits.hpp | 2 ++ include/rexy/utility.hpp | 2 ++ 21 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 include/rexy/rexy.hpp.in diff --git a/.gitignore b/.gitignore index a8f3e97..59fbc13 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ tester.cpp pc/librexy.pc makefile test +include/rexy/rexy.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ca3640..3c8dfba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ project(librexy) cmake_minimum_required(VERSION 3.0.2) include(GNUInstallDirs) +set(librexy_VERSION_STRING "000010000L") set(librexy_VERSION_MAJOR 0) set(librexy_VERSION_MINOR 1) set(librexy_VERSION_REVISION 0) @@ -37,7 +38,7 @@ if(BUILD_TESTS) add_subdirectory(tests) endif() -set(LIBREXY_PUBLIC_HEADERS "include/rexy/algorithm.hpp" "include/rexy/utility.hpp" "include/rexy/basic_string_hash.hpp" "include/rexy/hash.hpp" "include/rexy/static_string_hash.hpp" "include/rexy/string_hash.hpp" "include/rexy/mpmc_queue.hpp" "include/rexy/mpmc_queue.tpp" "include/rexy/traits.hpp" "include/rexy/steal.hpp" "include/rexy/binary.hpp" "include/rexy/expression.hpp" "include/rexy/binary_base.hpp" "include/rexy/binary_base.tpp" "include/rexy/string_base.hpp" "include/rexy/string.hpp" "include/rexy/filerd.hpp" "include/rexy/string_base.tpp" "include/rexy/allocator.hpp" "include/rexy/meta.hpp") +set(LIBREXY_PUBLIC_HEADERS "include/rexy/rexy.hpp" "include/rexy/algorithm.hpp" "include/rexy/utility.hpp" "include/rexy/basic_string_hash.hpp" "include/rexy/hash.hpp" "include/rexy/static_string_hash.hpp" "include/rexy/string_hash.hpp" "include/rexy/mpmc_queue.hpp" "include/rexy/mpmc_queue.tpp" "include/rexy/traits.hpp" "include/rexy/steal.hpp" "include/rexy/binary.hpp" "include/rexy/expression.hpp" "include/rexy/binary_base.hpp" "include/rexy/binary_base.tpp" "include/rexy/string_base.hpp" "include/rexy/string.hpp" "include/rexy/filerd.hpp" "include/rexy/string_base.tpp" "include/rexy/allocator.hpp" "include/rexy/meta.hpp") target_compile_options(rexy PRIVATE -Wall -Wextra -pedantic -std=c++17) install(TARGETS rexy @@ -56,5 +57,9 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/pc/librexy.pc" @ONLY ) +configure_file( + "${INCLUDE_PATH}/rexy/rexy.hpp.in" + "${INCLUDE_PATH}/rexy/rexy.hpp" +) add_custom_target(uninstall cat install_manifest.txt | xargs rm) diff --git a/include/rexy/algorithm.hpp b/include/rexy/algorithm.hpp index 521fe1c..fb7c26d 100644 --- a/include/rexy/algorithm.hpp +++ b/include/rexy/algorithm.hpp @@ -20,6 +20,7 @@ #define REXY_ALGORITHM_HPP #include "utility.hpp" //swap +#include "rexy.hpp" #include //SIZE_MAX #include //size_t #include diff --git a/include/rexy/allocator.hpp b/include/rexy/allocator.hpp index 7865592..2fa4afb 100644 --- a/include/rexy/allocator.hpp +++ b/include/rexy/allocator.hpp @@ -24,6 +24,8 @@ #include #include //numeric_limits +#include "rexy.hpp" + namespace rexy{ template diff --git a/include/rexy/basic_string_hash.hpp b/include/rexy/basic_string_hash.hpp index e140354..bcc2ba6 100644 --- a/include/rexy/basic_string_hash.hpp +++ b/include/rexy/basic_string_hash.hpp @@ -22,6 +22,8 @@ #include "string_hash.hpp" #include "string.hpp" +#include "rexy.hpp" + namespace rexy{ template<> diff --git a/include/rexy/binary.hpp b/include/rexy/binary.hpp index 839c370..91600b3 100644 --- a/include/rexy/binary.hpp +++ b/include/rexy/binary.hpp @@ -21,6 +21,7 @@ #include "binary_base.hpp" #include "allocator.hpp" +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/binary_base.hpp b/include/rexy/binary_base.hpp index 508acdc..5ab647e 100644 --- a/include/rexy/binary_base.hpp +++ b/include/rexy/binary_base.hpp @@ -32,6 +32,7 @@ #include "traits.hpp" #include "detail/string_appender.hpp" #include "detail/hasallocator.hpp" +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/expression.hpp b/include/rexy/expression.hpp index 1467323..f89f4b0 100644 --- a/include/rexy/expression.hpp +++ b/include/rexy/expression.hpp @@ -22,6 +22,8 @@ #include #include //forward +#include "rexy.hpp" + namespace rexy{ template diff --git a/include/rexy/filerd.hpp b/include/rexy/filerd.hpp index 895f1bc..4b3c423 100644 --- a/include/rexy/filerd.hpp +++ b/include/rexy/filerd.hpp @@ -21,11 +21,13 @@ #include //FILE #include //size_t +#include //is_nothrow_constructible #include "string.hpp" +#include "steal.hpp" #include "binary.hpp" #include "utility.hpp" -#include +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/hash.hpp b/include/rexy/hash.hpp index fc1c69b..400f960 100644 --- a/include/rexy/hash.hpp +++ b/include/rexy/hash.hpp @@ -20,6 +20,7 @@ #define REXY_HASH_HPP #include //CHAR_BIT +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/meta.hpp b/include/rexy/meta.hpp index 8ed1529..559621b 100644 --- a/include/rexy/meta.hpp +++ b/include/rexy/meta.hpp @@ -19,6 +19,8 @@ #ifndef REXY_META_HPP #define REXY_META_HPP +#include "rexy.hpp" + namespace rexy{ template diff --git a/include/rexy/mpmc_queue.hpp b/include/rexy/mpmc_queue.hpp index c35309e..66b3dd8 100644 --- a/include/rexy/mpmc_queue.hpp +++ b/include/rexy/mpmc_queue.hpp @@ -23,6 +23,8 @@ #include //size_t #include //atomic (duh) +#include "rexy.hpp" + #ifdef __cpp_lib_hardware_interference_size #include //hardware_destructive_interference_size #endif diff --git a/include/rexy/rexy.hpp.in b/include/rexy/rexy.hpp.in new file mode 100644 index 0000000..10a26c1 --- /dev/null +++ b/include/rexy/rexy.hpp.in @@ -0,0 +1,24 @@ +/** + This file is a part of rexy's general purpose library + Copyright (C) 2021 rexy712 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef REXY_REXY_HPP +#define REXY_REXY_HPP + +#define LIBREXY_VERSION @librexy_VERSION_STRING@ + +#endif diff --git a/include/rexy/static_string_hash.hpp b/include/rexy/static_string_hash.hpp index 1728e04..48e1cc4 100644 --- a/include/rexy/static_string_hash.hpp +++ b/include/rexy/static_string_hash.hpp @@ -21,6 +21,7 @@ #include "string_hash.hpp" #include "string_base.hpp" +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/steal.hpp b/include/rexy/steal.hpp index 65b362b..f5abdbc 100644 --- a/include/rexy/steal.hpp +++ b/include/rexy/steal.hpp @@ -20,8 +20,9 @@ #define REXY_STEAL_HPP #include //forward +#include //is_nothrow_constructible -#include +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/string.hpp b/include/rexy/string.hpp index cc831c0..b2cd045 100644 --- a/include/rexy/string.hpp +++ b/include/rexy/string.hpp @@ -21,6 +21,7 @@ #include "string_base.hpp" #include "allocator.hpp" +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/string_base.hpp b/include/rexy/string_base.hpp index 3eb1746..8898000 100644 --- a/include/rexy/string_base.hpp +++ b/include/rexy/string_base.hpp @@ -32,6 +32,7 @@ #include "expression.hpp" #include "detail/string_appender.hpp" #include "detail/hasallocator.hpp" +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/string_hash.hpp b/include/rexy/string_hash.hpp index 5fbbb1a..b40594e 100644 --- a/include/rexy/string_hash.hpp +++ b/include/rexy/string_hash.hpp @@ -20,6 +20,7 @@ #define REXY_STRING_HASH_HPP #include "hash.hpp" +#include "rexy.hpp" namespace rexy{ diff --git a/include/rexy/threadpool.hpp b/include/rexy/threadpool.hpp index 893d1ff..70ba8f8 100644 --- a/include/rexy/threadpool.hpp +++ b/include/rexy/threadpool.hpp @@ -30,6 +30,8 @@ #include //function, bind #include //move, forward +#include "rexy.hpp" + namespace rexy{ class threadpool diff --git a/include/rexy/traits.hpp b/include/rexy/traits.hpp index 12aa610..fa1d7a3 100644 --- a/include/rexy/traits.hpp +++ b/include/rexy/traits.hpp @@ -21,6 +21,8 @@ #include //is_same, decay, integral_constant, declval +#include "rexy.hpp" + namespace rexy{ template diff --git a/include/rexy/utility.hpp b/include/rexy/utility.hpp index 9eb5506..a9cbb77 100644 --- a/include/rexy/utility.hpp +++ b/include/rexy/utility.hpp @@ -23,6 +23,8 @@ #include //size_t #include +#include "rexy.hpp" + namespace rexy{ namespace{