aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2019-12-26 16:50:08 +0100
committerFelix Morgner <felix.morgner@gmail.com>2019-12-26 16:50:08 +0100
commit99a77dd3122282f9509e7a4ec8bfd5b14b73e929 (patch)
treee65be356e2ef4250ac1e66626324cab8d7555f39
parent2184a7d0920fbf6208edcca4c82bd273ec37749a (diff)
downloadnewtype-99a77dd3122282f9509e7a4ec8bfd5b14b73e929.tar.xz
newtype-99a77dd3122282f9509e7a4ec8bfd5b14b73e929.zip
doc: install dependencies before building docs
-rw-r--r--CMakeLists.txt14
-rw-r--r--doc/Pipfile2
-rw-r--r--doc/Pipfile.lock23
-rw-r--r--include/newtype/new_type.hpp6
4 files changed, 21 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 845903b..070fdb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,10 +90,20 @@ if(BUILD_DOCS)
message(FATAL_ERROR "Could not find pipenv")
endif()
- add_custom_target("docs" ALL
+ add_custom_target("pipenv_install"
+ COMMAND "${PIPENV_EXE}" "install" ">/dev/null"
+ COMMENT "Installing pipenv dependencies"
+ WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/doc"
+ )
+
+ add_custom_target("docs"
DEPENDS "${PROJECT_BINARY_DIR}/doc/html/index.html" "${PROJECT_BINARY_DIR}/doc/man/newtype.3"
+ WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/doc"
+ COMMENT "Building documentation"
)
+ add_dependencies("docs" "pipenv_install")
+
add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/doc/html/index.html"
COMMAND "${PIPENV_EXE}" "run" "sphinx-build" "-b" "singlehtml" "${PROJECT_SOURCE_DIR}/doc/src" "${PROJECT_BINARY_DIR}/doc/html" ">/dev/null"
DEPENDS "${PROJECT_SOURCE_DIR}/doc/src/index.rst" "${PROJECT_SOURCE_DIR}/doc/src/conf.py"
@@ -108,6 +118,8 @@ if(BUILD_DOCS)
COMMENT "Compiling man pages"
)
+ add_dependencies("${PROJECT_NAME}" "docs")
+
install(DIRECTORY "${PROJECT_BINARY_DIR}/doc/html"
DESTINATION "share/doc/${PROJECT_NAME}"
PATTERN ".nojekyll" EXCLUDE
diff --git a/doc/Pipfile b/doc/Pipfile
index 92d66ea..83bd30b 100644
--- a/doc/Pipfile
+++ b/doc/Pipfile
@@ -7,8 +7,6 @@ verify_ssl = true
[packages]
sphinx = "*"
-breathe = "*"
-sphinx-better-theme = "*"
[requires]
python_version = "3"
diff --git a/doc/Pipfile.lock b/doc/Pipfile.lock
index fca92c1..f23f13b 100644
--- a/doc/Pipfile.lock
+++ b/doc/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "867ebbc446f1c3064607a63aa5b4a7f0b53e2878ee60ccb51b6d33e320622f25"
+ "sha256": "776b8d64e53c6045ac2d3198bb1516e980e399d054e903e0769d4e6c13350e50"
},
"pipfile-spec": 6,
"requires": {
@@ -30,14 +30,6 @@
],
"version": "==2.7.0"
},
- "breathe": {
- "hashes": [
- "sha256:178848e4088faf8c2c60f000379fcabfb3411b260e0fbddc08fb57e0e5caea08",
- "sha256:94b4267355571f729038eaad076dab9a851016c5d8b9ba156e2e2360dbbf930d"
- ],
- "index": "pypi",
- "version": "==4.14.0"
- },
"certifi": {
"hashes": [
"sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3",
@@ -130,10 +122,10 @@
},
"pyparsing": {
"hashes": [
- "sha256:20f995ecd72f2a1f4bf6b072b63b22e2eb457836601e76d6e5dfcd75436acc1f",
- "sha256:4ca62001be367f01bd3e92ecbb79070272a9d4964dce6a48a82ff0b8bc7e683a"
+ "sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f",
+ "sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec"
],
- "version": "==2.4.5"
+ "version": "==2.4.6"
},
"pytz": {
"hashes": [
@@ -171,13 +163,6 @@
"index": "pypi",
"version": "==2.3.1"
},
- "sphinx-better-theme": {
- "hashes": [
- "sha256:420570d80d8cab25b35cef2b79619104675777dff5a23deebe9ba2191d48c1ce"
- ],
- "index": "pypi",
- "version": "==0.1.5"
- },
"sphinxcontrib-applehelp": {
"hashes": [
"sha256:edaa0ab2b2bc74403149cb0209d6775c96de797dfd5b5e2a71981309efab3897",
diff --git a/include/newtype/new_type.hpp b/include/newtype/new_type.hpp
index 4d8ad66..0dc0ff6 100644
--- a/include/newtype/new_type.hpp
+++ b/include/newtype/new_type.hpp
@@ -102,6 +102,8 @@ namespace nt
auto constexpr static derivations = DerivationClause;
public:
+ using impl::new_type_storage<BaseType, TagType>::decay;
+
/**
* Convert this instance into the equivalent base type value
*
@@ -111,7 +113,7 @@ namespace nt
template<typename NewType = new_type, std::enable_if_t<NewType::derivations(nt::ImplicitConversion)> * = nullptr>
constexpr operator base_type() const noexcept(std::is_nothrow_copy_constructible_v<base_type>)
{
- return this->decay();
+ return decay();
}
/**
@@ -123,7 +125,7 @@ namespace nt
template<typename NewType = new_type, std::enable_if_t<!NewType::derivations(nt::ImplicitConversion)> * = nullptr>
explicit constexpr operator base_type() const noexcept(std::is_nothrow_copy_constructible_v<base_type>)
{
- return this->decay();
+ return decay();
}
};