Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

Commit 7ee9168

Browse files
committed
BUILD: Add force-build flag and enable pedantic warnings for GCC and Clang.
Ref #1
1 parent 0327e78 commit 7ee9168

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ function(enable_warnings target)
4040
target_compile_options(${target} PRIVATE
4141
-Wall
4242
-Wextra
43-
# -Wpedantic
44-
# -Wconversion
45-
# -Wshadow
46-
# -Wnon-virtual-dtor
47-
# -Wold-style-cast
48-
# -Woverloaded-virtual
43+
-Wpedantic
44+
-Wconversion
45+
-Wshadow
46+
-Wnon-virtual-dtor
47+
-Wold-style-cast
48+
-Woverloaded-virtual
4949
)
5050
endif ()
5151
endfunction()

‎make.py‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ def subcommand_setup():
4646

4747

4848
def subcommand_build():
49-
build_dir = Path(BUILD_DIR)
50-
subprocess.run(["cmake", "--build", str(build_dir)], check=True)
49+
command = ["cmake", "--build", BUILD_DIR]
50+
if FORCE_BUILD:
51+
command.append("--clean-first")
52+
subprocess.run(command, check=True)
5153

5254

5355
def subcommand_test():
@@ -67,6 +69,16 @@ def subcommand_test():
6769
default="cmake-build-debug",
6870
help="CMake build directory (default: %(default)s)",
6971
)
72+
parser.add_argument(
73+
"--force",
74+
action="store_true",
75+
help="Clean before building",
76+
)
77+
parser.add_argument(
78+
"--warnings-as-errors",
79+
action="store_true",
80+
help="Treat compiler warnings as errors",
81+
)
7082
parser.add_argument(
7183
"--venv-dir",
7284
default="venv",
@@ -83,6 +95,7 @@ def subcommand_test():
8395
args = parser.parse_args()
8496
BUILD_DIR = args.build_dir
8597
VENV_DIR = args.venv_dir
98+
FORCE_BUILD = args.force
8699

87100
match args.command:
88101
case "setup":

0 commit comments

Comments
 (0)