Skip to content

Commit 0dd36eb

Browse files
committed
Add more files and fixes for mac
1 parent 383d91f commit 0dd36eb

1 file changed

Lines changed: 51 additions & 15 deletions

File tree

scripts/make_distro_output.py

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,20 @@
4545
(("bin", f"ReleaseNoEditor-{platform_as_str}-x86_64", f"ToadRunner{exe_ext}"), ("bin",), f"ToadRunnerNoEditor{exe_ext}"),
4646
(("bin", f"ReleaseNoEditor-{platform_as_str}-x86_64", f"{dlib_prefix}Engine{dlib_ext}"), ("bin",), ""),
4747
(("bin", f"DebugNoEditor-{platform_as_str}-x86_64", f"ToadRunner{exe_ext}"), ("bin", "debug"), f"ToadRunnerNoEditorDebug{exe_ext}"),
48-
(("bin", f"DebugNoEditor-{platform_as_str}-x86_64", f"{dlib_prefix}Engine{dlib_ext}"), ("bin", "debug"), ""),
48+
(("bin", f"DebugNoEditor-{platform_as_str}-x86_64", f"{dlib_prefix}Engine{dlib_ext}"), ("bin", "debug"), f"{dlib_prefix}EngineDebug{dlib_ext}"),
4949
(("bin", f"TestNoEditor-{platform_as_str}-x86_64", f"ToadRunner{exe_ext}"), ("bin", "debug"), f"ToadRunnerNoEditorTest{exe_ext}"),
50-
(("bin", f"TestNoEditor-{platform_as_str}-x86_64", f"{dlib_prefix}Engine{dlib_ext}"), ("bin", "debug"), ""),
50+
(("bin", f"TestNoEditor-{platform_as_str}-x86_64", f"{dlib_prefix}Engine{dlib_ext}"), ("bin", "debug"), f"{dlib_prefix}EngineTest{dlib_ext}"),
5151
(("scripts", "generate_game_project.lua"), ("scripts",), ""),
52-
(("ToadRunner", "imgui-main.ini"), ("",), ""),
53-
(("ToadRunner", "imgui-anim.ini"), ("",), ""),
52+
(("scripts", "cmake"), ("scripts", "cmake"), ""),
53+
(("", "imgui-main.ini"), ("",), ""),
54+
(("", "imgui-anim.ini"), ("",), ""),
55+
(("", "imgui.ini"), ("",), ""),
5456
(("vendor", "bin", f"premake5{exe_ext}"), ("bin",), ""),
5557
(("vendor", "bin", "LICENSE.txt"), ("bin",), ""),
5658
(("vendor", "imgui"), ("game_templates", "vendor", "imgui"), ""),
5759
(("vendor", "json"), ("game_templates", "vendor", "json"), ""),
60+
(("vendor", "magic_enum"), ("game_templates", "vendor", "magic_enum"), ""),
61+
(("vendor", "implot"), ("game_templates", "vendor", "implot"), ""),
5862
(("vendor", "filewatch"), ("game_templates", "vendor", "filewatch"), ""),
5963
(("vendor", "SFML-3.0.0"), ("game_templates", "vendor", "SFML-3.0.0"), ""),
6064
(("vendor", "SFML-3.0.0", sfml_bin_folder, f"{dlib_prefix}sfml-audio{sfml_version_suffix}{dlib_ext}"), (""), ""),
@@ -70,25 +74,38 @@
7074
(("vendor", "sfml-imgui"), ("game_templates", "vendor", "sfml-imgui"), ""),
7175
]
7276

73-
# files and folders to ignore
74-
ignore = [
77+
# folders to ignore
78+
ignore_folders = [
7579
"examples",
7680
"cmake",
7781
"docs",
7882
"doc",
83+
"misc",
7984
]
8085

86+
# ignore_files = [
87+
# "imgui_impl_allegro5.cpp",
88+
# "imgui_impl_allegro5.h",
89+
# ]
90+
91+
if sys.platform == "darwin":
92+
ignore_folders.append("vulkan")
93+
ignore_folders.append("sdlgpu3")
94+
8195
# not needed but should be copied if possible
8296
optional_files = [
8397
"imgui-main.ini",
8498
"imgui-anim.ini",
99+
"imgui.ini",
100+
"thumbnail.png",
85101
]
86102

87103
# add game templates
88104
for gt in game_templates:
89105
files.append((("GameTemplates", gt, "src"), ("game_templates", gt, "src"), ""))
90106
files.append((("GameTemplates", gt, "readme.txt"), ("game_templates", gt ), ""))
91107
files.append((("GameTemplates", gt, "premake5.lua"), ("game_templates", gt), ""))
108+
files.append((("GameTemplates", gt, "thumbnail.png"), ("game_templates", gt), ""))
92109

93110
def should_skip_macos(entry):
94111
file = os.path.basename(entry)
@@ -100,9 +117,25 @@ def should_skip_macos(entry):
100117
if file.endswith(".lib"):
101118
return True
102119

120+
print(entry)
121+
103122
# premake5 binary not given for macos system
104123
if file == "premake5":
105124
return True
125+
126+
# TODO: make this work
127+
imgui_backends_to_use = [
128+
"imgui_impl_metal.mm",
129+
"imgui_impl_metal.h",
130+
"imgui_impl_opengl2.cpp",
131+
"imgui_impl_opengl2.h",
132+
"imgui_impl_osx.mm",
133+
"imgui_impl_osx.h",
134+
]
135+
136+
if "imgui_impl" in file:
137+
if file not in imgui_backends_to_use:
138+
return False
106139

107140
return False
108141

@@ -138,14 +171,14 @@ def create_sfml_symlinks(dir):
138171
for relative, _, _ in files:
139172
path = os.path.join(proj_dir, *relative)
140173
if not os.path.exists(path):
141-
for optional_file in optional_files:
142-
if optional_file not in relative:
143-
if sys.platform == "darwin":
144-
if should_skip_macos(path):
145-
continue
174+
file = relative[-1]
175+
if file not in optional_files:
176+
if sys.platform == "darwin":
177+
if should_skip_macos(path):
178+
continue
146179

147-
print(f"Error: Path doesn't exist: {path}")
148-
is_valid = False
180+
print(f"Error: Path doesn't exist: {path}")
181+
is_valid = False
149182

150183
if not is_valid:
151184
sys.exit(1)
@@ -155,11 +188,14 @@ def create_sfml_symlinks(dir):
155188
os.makedirs(os.path.join(dir_out, "game_templates"), exist_ok=True)
156189
os.makedirs(os.path.join(dir_out, "game_templates/src"), exist_ok=True)
157190
os.makedirs(os.path.join(dir_out, "game_templates/vendor"), exist_ok=True)
158-
os.makedirs(os.path.join(dir_out, "libs"), exist_ok=True)
159191
os.makedirs(os.path.join(dir_out, "script_api"), exist_ok=True)
160192
os.makedirs(os.path.join(dir_out, "scripts"), exist_ok=True)
161193
os.path.join(proj_dir, "bin", f"Release-{platform_as_str}-x86_64")
162194

195+
if sys.platform == "win32":
196+
os.makedirs(os.path.join(dir_out, "libs"), exist_ok=True)
197+
198+
163199
for relative, relative_dest, rename in files:
164200

165201
path_src = os.path.join(proj_dir, *relative)
@@ -199,7 +235,7 @@ def create_sfml_symlinks(dir):
199235
print(f"Copy: {path_src} to {path_dst}")
200236

201237
if os.path.isdir(path_src):
202-
shutil.copytree(path_src, os.path.join(path_dst, rename), dirs_exist_ok=True, ignore=shutil.ignore_patterns(*ignore))
238+
shutil.copytree(path_src, os.path.join(path_dst, rename), dirs_exist_ok=True, ignore=shutil.ignore_patterns(*ignore_folders))
203239
else:
204240
shutil.copy2(path_src, os.path.join(path_dst, rename))
205241

0 commit comments

Comments
 (0)