diff options
author | Lukas Rusak <lorusak@gmail.com> | 2021-12-21 19:18:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-21 19:18:51 -0800 |
commit | 5498d117fda9aea2a89192f6f36a65183f2a9dd5 (patch) | |
tree | 89033b619218ed4b60250952c867a824fc892a6c /tools/depends/target | |
parent | eb41b3119e2b539300ff83931aa170ffdbfb5c41 (diff) | |
parent | 26c7bc891468ffbdda3e9a045837fdbe43f1c98e (diff) |
Merge pull request #20699 from lrusak/cpp17
c++17 round two
Diffstat (limited to 'tools/depends/target')
-rw-r--r-- | tools/depends/target/libfmt/Makefile | 2 | ||||
-rw-r--r-- | tools/depends/target/libspdlog/Makefile | 2 | ||||
-rw-r--r-- | tools/depends/target/p8-platform/0001-fix-c++17-support.patch | 22 | ||||
-rw-r--r-- | tools/depends/target/p8-platform/Makefile | 4 |
4 files changed, 26 insertions, 4 deletions
diff --git a/tools/depends/target/libfmt/Makefile b/tools/depends/target/libfmt/Makefile index 467ac989a8..a9d48bc8d6 100644 --- a/tools/depends/target/libfmt/Makefile +++ b/tools/depends/target/libfmt/Makefile @@ -7,7 +7,7 @@ VERSION=8.0.1 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz -CMAKE_OPTIONS=-DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_EXTENSIONS:BOOL=OFF -DFMT_DOC=OFF -DFMT_INSTALL=ON -DFMT_TEST=OFF +CMAKE_OPTIONS=-DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS:BOOL=OFF -DFMT_DOC=OFF -DFMT_INSTALL=ON -DFMT_TEST=OFF ifeq ($(CROSS_COMPILING), yes) DEPS += ../../Makefile.include diff --git a/tools/depends/target/libspdlog/Makefile b/tools/depends/target/libspdlog/Makefile index b7d592d635..3d55e91f20 100644 --- a/tools/depends/target/libspdlog/Makefile +++ b/tools/depends/target/libspdlog/Makefile @@ -17,7 +17,7 @@ CMAKE_OPTIONS= \ ifeq ($(CROSS_COMPILING), yes) DEPS += ../../Makefile.include else - CXXFLAGS += -std=c++14 + CXXFLAGS += -std=c++17 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) ifeq ($(PLATFORM),) diff --git a/tools/depends/target/p8-platform/0001-fix-c++17-support.patch b/tools/depends/target/p8-platform/0001-fix-c++17-support.patch new file mode 100644 index 0000000000..25fbe483fe --- /dev/null +++ b/tools/depends/target/p8-platform/0001-fix-c++17-support.patch @@ -0,0 +1,22 @@ +diff --git a/src/util/StringUtils.cpp b/src/util/StringUtils.cpp +index 510e2d5..3d25ba7 100644 +--- a/src/util/StringUtils.cpp ++++ b/src/util/StringUtils.cpp +@@ -453,7 +453,7 @@ static int isspace_c(char c) + + std::string& StringUtils::TrimLeft(std::string &str) + { +- str.erase(str.begin(), ::find_if(str.begin(), str.end(), ::not1(::ptr_fun(isspace_c)))); ++ str.erase(str.begin(), ::find_if(str.begin(), str.end(), [](char s) { return isspace_c(s) == 0; })); + return str; + } + +@@ -466,7 +466,7 @@ std::string& StringUtils::TrimLeft(std::string &str, const char* const chars) + + std::string& StringUtils::TrimRight(std::string &str) + { +- str.erase(::find_if(str.rbegin(), str.rend(), ::not1(::ptr_fun(isspace_c))).base(), str.end()); ++ str.erase(::find_if(str.rbegin(), str.rend(), [](char s) { return isspace_c(s) == 0; }).base(), str.end()); + return str; + } + diff --git a/tools/depends/target/p8-platform/Makefile b/tools/depends/target/p8-platform/Makefile index 257f7e0561..e473262862 100644 --- a/tools/depends/target/p8-platform/Makefile +++ b/tools/depends/target/p8-platform/Makefile @@ -1,5 +1,5 @@ include ../../Makefile.include -DEPS= ../../Makefile.include Makefile +DEPS= ../../Makefile.include Makefile 0001-fix-c++17-support.patch # lib name, version LIBNAME=p8-platform @@ -17,6 +17,7 @@ $(TARBALLS_LOCATION)/$(ARCHIVE): $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) + cd $(PLATFORM); patch -p1 -i ../0001-fix-c++17-support.patch cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=0 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. $(LIBDYLIB): $(PLATFORM) @@ -31,4 +32,3 @@ clean: distclean:: rm -rf $(PLATFORM) .installed-$(PLATFORM) - |