Skip to content

Commit

Permalink
Fix build with recent clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Jan 21, 2024
1 parent fea0c7f commit 1b050af
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

@contextlib.contextmanager
def patched_path(path, old, new):
contents = path.read_text()
contents = path.read_text("latin-1")
if old not in contents:
raise Exception(f"Invalid patch: {old}")
try:
path.write_text(contents.replace(old, new))
path.write_text(contents.replace(old, new), "utf-8")
yield
finally:
path.write_text(contents)
path.write_text(contents, "latin-1")


patches = [
Expand All @@ -29,9 +29,14 @@ def patched_path(path, old, new):
("Makefiles/Makefile_Mac_clang_shared",
"$(COMPILE_FLAGS)", "$(COMPILE_FLAGS) $(CFLAGS)"),
("Makefiles/Makefile_Mac_clang_shared",
"-Wextra", "-Wextra -Wno-deprecated-declarations -Wno-sign-conversion"),
"-Wextra",
"-Wextra "
"-Wno-deprecated-declarations "
"-Wno-sign-conversion "
"-Wno-array-parameter"),
("Makefiles/Makefile_Mac_clang_shared",
"$(LINK_FLAGS)", "$(LINK_FLAGS) -lc++"),
("Moves.cpp", "", ""), # Only for reencoding.
]


Expand Down

0 comments on commit 1b050af

Please sign in to comment.