Skip to content

Commit 4558c87

Browse files
committed
Move compile_commands.json instead of copying
1 parent c8d3311 commit 4558c87

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "emake"
7-
version = "1.3.1"
7+
version = "1.4.0"
88
description = "Easy wrapper around CMake's CLI"
99
authors = [{name = "Jon Palmisciano", email = "jp@jonpalmisc.com"}]
1010
readme = "README.md"

‎src/emake/cli/econf.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"""
1717

1818
from emake.core.config import configure
19-
from emake.core.make import build
2019

2120
from docopt import docopt
2221

‎src/emake/core/make.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ def build(build_dir: str, target: Optional[str]) -> None:
2020
if jobs := user.build.jobs:
2121
command += ["-j", str(jobs)]
2222

23-
# Copy compile_commands.json to project root if requested.
23+
# Move 'compile_commands.json' to project root if requested.
2424
build_cc_path = Path(build_dir).joinpath("compile_commands.json")
25-
if build_cc_path.is_file() and user.build.copy_cc:
25+
should_move = user.build.copy_cc or user.build.move_cc
26+
if should_move and build_cc_path.is_file():
2627
dest_cc_path = Path(build_dir).parent.joinpath("compile_commands.json")
27-
shutil.copy(str(build_cc_path), str(dest_cc_path))
28+
shutil.move(str(build_cc_path), str(dest_cc_path))
2829

2930
call(command)

‎src/emake/core/settings.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def _get_opts(config: Path) -> Union[Dict[str, Any], Dict]:
13-
""" Get values from a given TOML configuration. """
13+
"""Get values from a given TOML configuration."""
1414

1515
try:
1616
with config.open("rb") as f:

0 commit comments

Comments
 (0)