Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove add_flags method in setup.py by fixing cmake config file #50

Open
mithro opened this issue Feb 16, 2021 · 0 comments
Open

Remove add_flags method in setup.py by fixing cmake config file #50

mithro opened this issue Feb 16, 2021 · 0 comments

Comments

@mithro
Copy link
Contributor

mithro commented Feb 16, 2021

The pull request at #48 adds a add_flags method. These flags should be instead correctly set via detection in the cmake file.

The code is shown below;

    def add_flags(self):
        if sys.platform.startswith('win'):
            return


        for flag in ["CFLAGS", "CXXFLAGS"]:
            flags = [os.environ.get(flag, "")]
            if not flags[0]:
                flags.pop(0)


            if shared_options.antlr_runtime == 'static':
                # When linking the ANTLR runtime statically, -fPIC is
                # still necessary because libparse_fasm will be a
                # shared library.
                flags.append("-fPIC")


            # FIXME: These should be in the cmake config file?
            # Disable excessive warnings currently in ANTLR runtime.
            # warning: type attributes ignored after type is already defined
            # `class ANTLR4CPP_PUBLIC ATN;`
            flags.append('-Wno-attributes')


            # Lots of implicit fallthroughs.
            # flags.append('-Wimplicit-fallthrough=0')


            if flags:
                os.environ[flag] = " ".join(flags)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant