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

[question] toolchains: generate in a list of scopes? #12606

Open
1 task done
SpaceIm opened this issue Nov 25, 2022 · 0 comments
Open
1 task done

[question] toolchains: generate in a list of scopes? #12606

SpaceIm opened this issue Nov 25, 2022 · 0 comments

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 25, 2022

Sorry if I already asked, but in high level toolchains helpers, is it possible to call generate() method of these helpers with a list of scopes?

In boost recipe I would need to create a custom scope which has everything from build scope except one toolchain, so that onespecific self.run afterwards during build() is called with this custom scope, but all other self.run of build() should be executed with build scope. See conan-io/conan-center-index#14415 (comment)

In conan v1, it was quite easy to have fine-grained env vars for each self.run. But with conan v2 paradigm where all vars are supposed to be written in one or several scripts in generate() and associated to scope names, so that they can be called afterwards, it's less obvious.

Current generate() of boost recipe in conan-io/conan-center-index#14415 is quite simple:

    def generate(self):
        if not self.options.header_only:
            env = VirtualBuildEnv(self)
            env.generate()
            if is_msvc(self):
                vc = VCVars(self)
                vc.generate()

But would it be possible to have something like this (pretty sure it doesn't work currently since scope argument expects a string):

    def generate(self):
        if not self.options.header_only:
            env = VirtualBuildEnv(self)
            env.generate(scope=["build", "build_but_without_vc_vars_when_b2_is_called"])
            if is_msvc(self):
                vc = VCVars(self)
                vc.generate()
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