Skip to content

Commit 467981c

Browse files
committed
improve v2-boost.py
1 parent e7fcabf commit 467981c

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 3.5...3.16)
66

77
project(boost_openmethod VERSION 1.87.0 LANGUAGES CXX)
88

9+
if(NOT CMAKE_CXX_STANDARD)
10+
set(CMAKE_CXX_STANDARD 17)
11+
endif()
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
13+
914
add_library(boost_openmethod INTERFACE)
1015
add_library(Boost::openmethod ALIAS boost_openmethod)
1116

dev/v2-boost.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from pathlib import Path
55
import re
66
from subprocess import check_call
7+
import subprocess
8+
import sys
79

810
BOOST_NAME = "openmethod"
911
BOOST_INCLUDE = Path("include", "boost", BOOST_NAME)
@@ -21,6 +23,13 @@
2123
("YOMM2_CLASS(ES)?|register_class(es)?", "BOOST_OPENMETHOD_CLASSES"),
2224
)
2325

26+
modified = subprocess.check_output(
27+
"git diff --name-only include/boost test".split(), encoding="ascii"
28+
)
29+
30+
if modified:
31+
sys.exit("Output directories have unstaged changes:\n" + modified)
32+
2433

2534
def skip(path):
2635
for skip in SKIP:
@@ -30,8 +39,6 @@ def skip(path):
3039
return False
3140

3241

33-
writeable = []
34-
3542
for from_path in list(YOMM2_INCLUDE.rglob("*.hpp")) + list(YOMM2_TESTS.rglob("*.?pp")):
3643
if skip(from_path):
3744
continue
@@ -54,20 +61,9 @@ def skip(path):
5461

5562
to_path.parent.mkdir(parents=True, exist_ok=True)
5663

57-
if to_path.exists():
58-
if os.access(to_path, os.W_OK):
59-
print("file is writeable, skipping")
60-
writeable.append(to_path)
61-
continue
62-
os.chmod(to_path, 0o744)
63-
6464
with to_path.open("w") as f:
6565
f.write(content)
6666

6767
check_call(["clang-format", "-i", str(to_path)])
6868

69-
os.chmod(to_path, 0o444)
7069
print("done")
71-
72-
if writeable:
73-
print("Skipped because writeable:", *writeable)

test/Jamfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ project
2222
;
2323

2424
# list
25-
run blackbox.cpp ;
25+
run test_blackbox.cpp ;
2626

2727
# quick (for CI)
2828
alias quick : blackbox ;

0 commit comments

Comments
 (0)