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

Add MVP implementation of overriding options. #1457

Merged
merged 7 commits into from Apr 3, 2017

Conversation

Projects
None yet
5 participants
@jpakkane
Member

jpakkane commented Mar 10, 2017

Allow (eventually) overriding any options. Uses include:

  • disable werror on some targets
  • set language standard per target (e.g. C++03 and C++11 in the same build)
  • disable unity building targets that are not unity buildable
  • and so on

This is a rough idea, refinement comments welcome.

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Mar 27, 2017

Member

I like this PR overall, what's blocking it from merging?

Member

nirbheek commented Mar 27, 2017

I like this PR overall, what's blocking it from merging?

@jpakkane

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Mar 27, 2017

Member

Lack of review.

Member

jpakkane commented Mar 27, 2017

Lack of review.

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Mar 27, 2017

Member

Okay, I'll do a proper review of this tomorrow.

Member

nirbheek commented Mar 27, 2017

Okay, I'll do a proper review of this tomorrow.

@nirbheek

The rest of it looks good to me. The nice part about this rework is that at most some options won't be properly overriden per-target, which shouldn't cause regressions and can be fixed when reported.

Show outdated Hide outdated mesonbuild/coredata.py
Show outdated Hide outdated mesonbuild/backend/backends.py
@@ -1899,6 +1908,10 @@ def generate_single_compile(self, target, outfile, src, is_generated=False, head
abs_src = src.fname
else:
abs_src = os.path.join(self.environment.get_build_dir(), src.fname)
elif isinstance(src, mesonlib.File):

This comment has been minimized.

@nirbheek

nirbheek Mar 28, 2017

Member

Is this needed? We have an else: if isinstance(src, File): below again.

@nirbheek

nirbheek Mar 28, 2017

Member

Is this needed? We have an else: if isinstance(src, File): below again.

This comment has been minimized.

@jpakkane

jpakkane Mar 28, 2017

Member

It breaks if this is not there. Let's fix it when ripping out RawFile. Weirdly, I thought I already did it ages ago but apparently not.

@jpakkane

jpakkane Mar 28, 2017

Member

It breaks if this is not there. Let's fix it when ripping out RawFile. Weirdly, I thought I already did it ages ago but apparently not.

executable('mustunity', 'one.c', 'two.c')
executable('notunity', 'three.c', 'four.c',
override_options : ['unity=false'])

This comment has been minimized.

@nirbheek

nirbheek Mar 28, 2017

Member

Should test the other option types too, not just string. And maybe also test overriding options set from various sources: project(), built-in, command-line, meson_options, etc.

@nirbheek

nirbheek Mar 28, 2017

Member

Should test the other option types too, not just string. And maybe also test overriding options set from various sources: project(), built-in, command-line, meson_options, etc.

This comment has been minimized.

@jpakkane

jpakkane Mar 29, 2017

Member

Added werror test. You can't really override meson_options because these overrides are only used inside builtin targets and those do not look up project options.

@jpakkane

jpakkane Mar 29, 2017

Member

Added werror test. You can't really override meson_options because these overrides are only used inside builtin targets and those do not look up project options.

@tp-m

This comment has been minimized.

Show comment
Hide comment
@tp-m

tp-m Mar 28, 2017

Contributor

I can't meaningfully review this, but I am looking forward to seeing this land and using it.

Contributor

tp-m commented Mar 28, 2017

I can't meaningfully review this, but I am looking forward to seeing this land and using it.

@jpakkane

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Mar 28, 2017

Member

Updated apart from tests.

Member

jpakkane commented Mar 28, 2017

Updated apart from tests.

@jpakkane

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Apr 1, 2017

Member

Rebased, should be good now.

Member

jpakkane commented Apr 1, 2017

Rebased, should be good now.

@jpakkane jpakkane merged commit 8b73d80 into master Apr 3, 2017

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
ci/sideci Meow! No issues found. It's clean code!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jpakkane jpakkane deleted the overrides branch Apr 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment