Skip to content

Speed up Cython compilation process on Linux (cef_logging.cpp) #331

Open
@cztomczak

Description

@cztomczak

Currently in cython_setup.py there are -flto, -fdata-sections, -ffunction-sections flags being set that slow down compilation process siginifcantly:

if FAST_FLAG:
            extra_compile_args.extend(["-flto",
                                       "-std=gnu++11"])
            extra_link_args.extend(["-flto"])
        else:
            # Fix "ImportError ... undefined symbol ..." caused by CEF's
            # include/base/ headers by adding the -flto flag (Issue #230).
            # Unfortunately -flto prolongs compilation time significantly.
            # More on the other flags: https://stackoverflow.com/questions/
            # 6687630/ .
            extra_compile_args.extend(["-flto",
                                       "-fdata-sections",
                                       "-ffunction-sections",
                                       "-std=gnu++11"])
            extra_link_args.extend(["-flto",
                                    "-Wl,--gc-sections"])

Adding these flags was required due to undefined symbols in caused by "cef_logging.h" (include/base/). However I think this may be fixed by creating "cef_logging.cpp" which should include "cef_logging.h" and the compiled object should be included during linking.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions