Skip to content

Commit 6f1902d

Browse files
committed
Clean up unnecessary compiledb parameters
1 parent 0536d63 commit 6f1902d

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
@@ -2,15 +2,6 @@
22
import os
33

44

5-
def normalize_path(val, env):
6-
return val if os.path.isabs(val) else os.path.join(env.Dir("#").abspath, val)
7-
8-
9-
def validate_parent_dir(key, val, env):
10-
if not os.path.isdir(normalize_path(os.path.dirname(val), env)):
11-
raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val)))
12-
13-
145
libname = "EXTENSION-NAME"
156
projectdir = "demo"
167

@@ -20,33 +11,11 @@ customs = ["custom.py"]
2011
customs = [os.path.abspath(path) for path in customs]
2112

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

4016
Help(opts.GenerateHelpText(localEnv))
4117

4218
env = localEnv.Clone()
43-
env["compiledb"] = False
44-
45-
env.Tool("compilation_db")
46-
compilation_db = env.CompilationDatabase(
47-
normalize_path(localEnv["compiledb_file"], localEnv)
48-
)
49-
env.Alias("compiledb", compilation_db)
5019

5120
env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs})
5221

@@ -75,6 +44,4 @@ library = env.SharedLibrary(
7544
copy = env.InstallAs("{}/bin/{}/lib{}".format(projectdir, env["platform"], file), library)
7645

7746
default_args = [library, copy]
78-
if localEnv.get("compiledb", False):
79-
default_args += [compilation_db]
8047
Default(*default_args)

0 commit comments

Comments
 (0)