diff options
author | SCG82 <scg082+github@gmail.com> | 2021-03-16 12:51:29 +0300 |
---|---|---|
committer | SCG82 <scg082+github@gmail.com> | 2021-03-16 14:09:51 +0300 |
commit | e1e5dc6a28fccf9f8f7bd2ff051ac927dd3cea48 (patch) | |
tree | 5a167cc1821e78259414813e9fde2943d45b504c | |
parent | d4ebafaec2c30a810f80282a2a5bb3230c3d5234 (diff) |
Update project to C++11 compilation
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | src/Dependency.cpp | 2 | ||||
-rw-r--r-- | src/DylibBundler.cpp | 1 |
3 files changed, 11 insertions, 9 deletions
@@ -1,16 +1,17 @@ DESTDIR= PREFIX=/usr/local -CXXFLAGS = -O2 +CXXFLAGS=-O2 -std=c++11 + +CPP_FILES=$(wildcard src/*.cpp) +OBJ_FILES=$(notdir $(CPP_FILES:.cpp=.o)) all: dylibbundler -dylibbundler: - $(CXX) $(CXXFLAGS) -c -I./src ./src/Settings.cpp -o ./Settings.o - $(CXX) $(CXXFLAGS) -c -I./src ./src/DylibBundler.cpp -o ./DylibBundler.o - $(CXX) $(CXXFLAGS) -c -I./src ./src/Dependency.cpp -o ./Dependency.o - $(CXX) $(CXXFLAGS) -c -I./src ./src/main.cpp -o ./main.o - $(CXX) $(CXXFLAGS) -c -I./src ./src/Utils.cpp -o ./Utils.o - $(CXX) $(CXXFLAGS) -o ./dylibbundler ./Settings.o ./DylibBundler.o ./Dependency.o ./main.o ./Utils.o +dylibbundler: $(OBJ_FILES) + $(CXX) $(CXXFLAGS) -o $@ $(OBJ_FILES) + +%.o: src/%.cpp + $(CXX) -c $(CXXFLAGS) -I./src $< -o $@ clean: rm -f *.o diff --git a/src/Dependency.cpp b/src/Dependency.cpp index 66249bd..46edc32 100644 --- a/src/Dependency.cpp +++ b/src/Dependency.cpp @@ -45,7 +45,7 @@ std::string stripPrefix(std::string in) } std::string& rtrim(std::string &s) { - s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); + s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char c){ return !std::isspace(c); }).base(), s.end()); return s; } diff --git a/src/DylibBundler.cpp b/src/DylibBundler.cpp index 0eda069..72fa5a3 100644 --- a/src/DylibBundler.cpp +++ b/src/DylibBundler.cpp @@ -28,6 +28,7 @@ THE SOFTWARE. #include <cstdlib> #include <set> #include <map> +#include <sys/param.h> #ifdef __linux #include <linux/limits.h> #endif |