<pre style='margin:0'>
Michael Dickens (michaelld) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/09819f74ebbdfe1b3beb042ce40d642f8e1a6d7d">https://github.com/macports/macports-ports/commit/09819f74ebbdfe1b3beb042ce40d642f8e1a6d7d</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 09819f74ebbdfe1b3beb042ce40d642f8e1a6d7d
</span>Author: Michael Dickens <michaelld@macports.org>
AuthorDate: Tue Feb 12 14:55:30 2019 -0500
<span style='display:block; white-space:pre;color:#404040;'> cmake: add patch to correct checks for some c++14 and c++17 features
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The default cmake checks may or not work depending on the compiler, and especially the c++17 check doesn't really have c++17 features to check for ... so, fix the checks to actually look for some of that standard's features.
</span>---
devel/cmake/Portfile | 6 +-
.../files/patch-fix_cxx14_17_checks.devel.diff | 71 ++++++++++++++++++++++
.../files/patch-fix_cxx14_17_checks.release.diff | 59 ++++++++++++++++++
3 files changed, 134 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cmake/Portfile b/devel/cmake/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 758f547..63fedcd 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/cmake/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cmake/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -54,7 +54,8 @@ if {${subport} eq ${name}} {
</span> patch-Modules-noArchCheck.release.diff \
patch-CMakeFindFrameworks.cmake.release.diff \
patch-Source_CMakeVersionCompute.cmake.release.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-Source_Modules_FindLibUV.cmake.release.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-Source_Modules_FindLibUV.cmake.release.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-fix_cxx14_17_checks.release.diff
</span>
livecheck.type regex
livecheck.regex ${name}-(\[0-9.\]+)${extract.suffix}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -85,7 +86,8 @@ if {${subport} eq ${name}} {
</span> patch-Modules-noArchCheck.devel.diff \
patch-CMakeFindFrameworks.cmake.devel.diff \
patch-Source_CMakeVersionCompute.cmake.devel.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-Source_Modules_FindLibUV.cmake.devel.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-Source_Modules_FindLibUV.cmake.devel.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-fix_cxx14_17_checks.devel.diff
</span>
livecheck.type regex
livecheck.regex data-clipboard-text=\"(\[0-9a-g\]+)\"
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cmake/files/patch-fix_cxx14_17_checks.devel.diff b/devel/cmake/files/patch-fix_cxx14_17_checks.devel.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..8c2d890
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cmake/files/patch-fix_cxx14_17_checks.devel.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,71 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Source/Checks/cm_cxx14_check.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Source/Checks/cm_cxx14_check.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,8 +1,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <cstdio>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// actually use c++14 feature to force the compiler to do something,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// since it might otherwise try to optimize all of this out even if it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// doesn't understand it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <iostream>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <memory>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::unique_ptr<int> u(new int(0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return *u;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::unique_ptr < int > foo = std::make_unique < int > (4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::cout << "std::make_unique < int >(4) is '"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << *foo << "'" << std::endl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Source/Checks/cm_cxx17_check.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Source/Checks/cm_cxx17_check.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,22 +1,27 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <cstdio>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <memory>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <unordered_map>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// requires c++17 or newer, so will fail tests of c++14 or earlier
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <optional>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef _MSC_VER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <comdef.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <iostream>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::unique_ptr<int> u(new int(0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef _MSC_VER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // clang-cl has problems instantiating this constructor in C++17 mode
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // error: indirection requires pointer operand ('const _GUID' invalid)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // return *_IID;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- IUnknownPtr ptr{};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- IDispatchPtr disp(ptr);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++std::optional < std::string >
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++create
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(bool b) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (b) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return "foo!";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return {};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return *u;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::cout << "create(false) returned "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << create(false).value_or("empty")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << std::endl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::cout << "create(true) returned "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << create(true).value_or("empty")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << std::endl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cmake/files/patch-fix_cxx14_17_checks.release.diff b/devel/cmake/files/patch-fix_cxx14_17_checks.release.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..045ee55
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cmake/files/patch-fix_cxx14_17_checks.release.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,59 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Source/Checks/cm_cxx14_check.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Source/Checks/cm_cxx14_check.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,8 +1,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <cstdio>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// actually use c++14 feature to force the compiler to do something,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// since it might otherwise try to optimize all of this out even if it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// doesn't understand it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <iostream>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <memory>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::unique_ptr<int> u(new int(0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return *u;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::unique_ptr < int > foo = std::make_unique < int > (4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::cout << "std::make_unique < int >(4) is '"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << *foo << "'" << std::endl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Source/Checks/cm_cxx17_check.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Source/Checks/cm_cxx17_check.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,9 +1,27 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <cstdio>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <memory>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <unordered_map>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// requires c++17 or newer, so will fail tests of c++14 or earlier
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <optional>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <iostream>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++std::optional < std::string >
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++create
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(bool b) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (b) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return "foo!";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return {};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::unique_ptr<int> u(new int(0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return *u;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::cout << "create(false) returned "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << create(false).value_or("empty")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << std::endl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::cout << "create(true) returned "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << create(true).value_or("empty")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << std::endl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>