Skip to content

Commit ec27f76

Browse files
committed
Fix configure.py @DECOMP_OPT_FLAGS parsing
1 parent 85c61ed commit ec27f76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/configure.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
SCRIPT_DIR = Path(os.path.dirname(os.path.realpath(__file__)))
2121

22-
opt_flags_pattern = re.compile(r"@DECOMP_OPT_FLAGS\s*=\s*(\S*)")
22+
opt_flags_pattern = re.compile(r"@DECOMP_OPT_FLAGS\s*=\s*(.*)\s*")
2323

2424
class BuildFileType(Enum):
2525
C = 1
@@ -266,6 +266,12 @@ def __write_dll_builds(self):
266266
# Compile DLL sources
267267
dll_link_deps: "list[str]" = []
268268
for file in dll.files:
269+
# Determine variables
270+
variables: dict[str, str] = {}
271+
opt = file.opt
272+
if opt is not None and opt != self.config.default_opt_flags:
273+
variables["OPT_FLAGS"] = opt
274+
269275
# Determine command
270276
command: str
271277
if file.type == BuildFileType.C:
@@ -280,7 +286,7 @@ def __write_dll_builds(self):
280286
# Write command
281287
obj_build_path = f"$BUILD_DIR/{Path(file.obj_path).as_posix()}"
282288
src_build_path = Path(file.src_path).as_posix()
283-
self.writer.build(obj_build_path, command, src_build_path)
289+
self.writer.build(obj_build_path, command, src_build_path, variables=variables)
284290
dll_link_deps.append(obj_build_path)
285291

286292
# Link

0 commit comments

Comments
 (0)