Skip to content

Commit

Permalink
Fix custom module paths for the editor builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed Feb 17, 2024
1 parent 4ed0f09 commit 0871127
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,12 @@ for path in module_search_paths:
# from the built-in "modules" name (e.g. "custom_modules/summator/summator.h"),
# so it can be referenced simply as `#include "summator/summator.h"`
# independently of where a module is located on user's filesystem.
env_base.Prepend(CPPPATH=[path, os.path.dirname(path)])

if not os.path.isabs(path):
env_base.Prepend(CPPPATH=["#" + path, "#" + os.path.dirname(path)])
else:
env_base.Prepend(CPPPATH=[path, os.path.dirname(path)])

# Note: custom modules can override built-in ones.
modules_detected.update(modules)

Expand Down
2 changes: 1 addition & 1 deletion methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def convert_custom_modules_path(path):
if path == os.path.realpath("modules"):
raise ValueError(err_msg % "be a directory other than built-in `modules` directory.")

current_path = os.path.realpath(".")
current_path = os.path.realpath(".") + "/"

if path.startswith(current_path):
path = path.replace(current_path, "", 1)
Expand Down
6 changes: 5 additions & 1 deletion modules/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ env.modules_sources = []
env_modules.add_source_files(env.modules_sources, "register_module_types.gen.cpp")

for name, path in env.module_list.items():

if not os.path.isabs(path):
SConscript(name + "/SCsub") # Built-in.
if path.startswith("modules/"):
SConscript(name + "/SCsub") # Built-in.
else:
SConscript("../" + path + "/SCsub") # In the engine's folder, so start from there
else:
SConscript(path + "/SCsub") # Custom.

Expand Down

0 comments on commit 0871127

Please sign in to comment.