mirror of
https://github.com/godotengine/godot-cpp-template.git
synced 2025-12-31 21:48:10 +03:00
Print an error if the godot-cpp submodule hasn't been initialized
This makes the error that is printed easier to understand, with a command given as a solution to run. The error message is also colored to match how core Godot displays this kind of build errors.
This commit is contained in:
16
SConstruct
16
SConstruct
@@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import sys
|
||||
|
||||
from methods import print_error
|
||||
|
||||
|
||||
def normalize_path(val, env):
|
||||
@@ -48,6 +51,19 @@ compilation_db = env.CompilationDatabase(
|
||||
)
|
||||
env.Alias("compiledb", compilation_db)
|
||||
|
||||
submodule_initialized = False
|
||||
dir_name = 'godot-cpp'
|
||||
if os.path.isdir(dir_name):
|
||||
if os.listdir(dir_name):
|
||||
submodule_initialized = True
|
||||
|
||||
if not submodule_initialized:
|
||||
print_error("""godot-cpp is not available within this folder, as Git submodules haven't been initialized.
|
||||
Run the following command to download godot-cpp:
|
||||
|
||||
git submodule update --init --recursive""")
|
||||
sys.exit(1)
|
||||
|
||||
env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs})
|
||||
|
||||
env.Append(CPPPATH=["src/"])
|
||||
|
||||
Reference in New Issue
Block a user