Skip to content

Commit

Permalink
Add patch to fix CEF compilation issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ttalvitie committed Jan 22, 2024
1 parent 511dda4 commit 91bd400
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/build_patched_cef.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@ class ClipboardBrowservice : public Clipboard {
}
"""

# Hack to fix compilation issue
CSTRING_BUILDER_CC_HEADER_CODE = b"""\
#include <limits>
"""

def embed(data):
return "b64decode(\"" + b64encode(data).decode("ASCII") + "\")"

Expand Down Expand Up @@ -498,6 +504,14 @@ def run(cef_src_dir):
fp.write(old_code)
fp.write(""" + embed(FONT_RENDER_PARAMS_OVERRIDE_FOOTER_CC_CODE) + """)
cstring_builder_cc_path = os.path.join(cef_src_dir, "..", "base", "allocator", "partition_allocator", "src", "partition_alloc", "partition_alloc_base", "strings", "cstring_builder.cc")
log(f"Adding missing include to '{cstring_builder_cc_path}'")
with open(cstring_builder_cc_path, "rb") as fp:
old_code = fp.read()
with open(cstring_builder_cc_path, "wb") as fp:
fp.write(""" + embed(CSTRING_BUILDER_CC_HEADER_CODE) + """)
fp.write(old_code)
log("Browservice-specific CEF/Chromium patches applied successfully")
if __name__ == "__main__":
Expand Down

0 comments on commit 91bd400

Please sign in to comment.