Skip to content

Commit 25b371e

Browse files
authored
Merge pull request #40 from pupil1337/clean-compiledb
2 parents 392d223 + 6f1902d commit 25b371e

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

SConstruct

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import sys
55
from methods import print_error
66

77

8-
def normalize_path(val, env):
9-
return val if os.path.isabs(val) else os.path.join(env.Dir("#").abspath, val)
10-
11-
12-
def validate_parent_dir(key, val, env):
13-
if not os.path.isdir(normalize_path(os.path.dirname(val), env)):
14-
raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val)))
15-
16-
178
libname = "EXTENSION-NAME"
189
projectdir = "demo"
1910

@@ -23,33 +14,11 @@ customs = ["custom.py"]
2314
customs = [os.path.abspath(path) for path in customs]
2415

2516
opts = Variables(customs, ARGUMENTS)
26-
opts.Add(
27-
BoolVariable(
28-
key="compiledb",
29-
help="Generate compilation DB (`compile_commands.json`) for external tools",
30-
default=localEnv.get("compiledb", False),
31-
)
32-
)
33-
opts.Add(
34-
PathVariable(
35-
key="compiledb_file",
36-
help="Path to a custom `compile_commands.json` file",
37-
default=localEnv.get("compiledb_file", "compile_commands.json"),
38-
validator=validate_parent_dir,
39-
)
40-
)
4117
opts.Update(localEnv)
4218

4319
Help(opts.GenerateHelpText(localEnv))
4420

4521
env = localEnv.Clone()
46-
env["compiledb"] = False
47-
48-
env.Tool("compilation_db")
49-
compilation_db = env.CompilationDatabase(
50-
normalize_path(localEnv["compiledb_file"], localEnv)
51-
)
52-
env.Alias("compiledb", compilation_db)
5322

5423
submodule_initialized = False
5524
dir_name = 'godot-cpp'
@@ -92,6 +61,4 @@ library = env.SharedLibrary(
9261
copy = env.InstallAs("{}/bin/{}/{}lib{}".format(projectdir, env["platform"], filepath, file), library)
9362

9463
default_args = [library, copy]
95-
if localEnv.get("compiledb", False):
96-
default_args += [compilation_db]
9764
Default(*default_args)

0 commit comments

Comments
 (0)