forked from OctaForge/OctaBuild
switch to c++14 and make use of generalized lambda capture
parent
9ffcec83c8
commit
bfe9d5aff2
2
Makefile
2
Makefile
|
@ -5,7 +5,7 @@ OCTASTD_PATH = ../octastd
|
||||||
|
|
||||||
FILES = main.o globs.o cubescript.o
|
FILES = main.o globs.o cubescript.o
|
||||||
|
|
||||||
OB_CXXFLAGS += -std=c++11 -I. -I$(CUBESCRIPT_PATH) -I$(OCTASTD_PATH) -pthread
|
OB_CXXFLAGS += -std=c++14 -I. -I$(CUBESCRIPT_PATH) -I$(OCTASTD_PATH) -pthread
|
||||||
|
|
||||||
all: obuild
|
all: obuild
|
||||||
|
|
||||||
|
|
4
main.cc
4
main.cc
|
@ -573,9 +573,7 @@ int main(int argc, char **argv) {
|
||||||
os.add_command("shell", "C", [](ObState &os, ConstCharRange s) {
|
os.add_command("shell", "C", [](ObState &os, ConstCharRange s) {
|
||||||
auto cnt = os.counters.back();
|
auto cnt = os.counters.back();
|
||||||
cnt->incr();
|
cnt->incr();
|
||||||
String ds = s;
|
tpool.push([cnt, ds = String(s)]() {
|
||||||
/* in c++14 we can use generalized lambda captures to move the str */
|
|
||||||
tpool.push([cnt, ds]() {
|
|
||||||
int ret = system(ds.data());
|
int ret = system(ds.data());
|
||||||
if (ret && !cnt->result)
|
if (ret && !cnt->result)
|
||||||
cnt->result = ret;
|
cnt->result = ret;
|
||||||
|
|
|
@ -7,7 +7,7 @@ OS_PATH = "../octastd"
|
||||||
|
|
||||||
FILES = [main_ob.o globs_ob.o cubescript_ob.o]
|
FILES = [main_ob.o globs_ob.o cubescript_ob.o]
|
||||||
|
|
||||||
OB_CXXFLAGS = [@OB_CXXFLAGS -std=c++11 -I. -I@CS_PATH -I@OS_PATH -pthread]
|
OB_CXXFLAGS = [@OB_CXXFLAGS -std=c++14 -I. -I@CS_PATH -I@OS_PATH -pthread]
|
||||||
|
|
||||||
rule obuild $FILES [
|
rule obuild $FILES [
|
||||||
echo " LD" $target
|
echo " LD" $target
|
||||||
|
|
Loading…
Reference in New Issue