Skip to content

Add config parameter to xmake build/run/clean #6310

@SirLynix

Description

@SirLynix

Is your feature request related to a problem? Please describe.

Hello,

When using xmake from a vsxmake (or other) project, building a project will run two commands:

xmake config --mode=debug --foo=bar ...
xmake build TargetName

this works but has some issues :

  1. it requires the xmake.lua to be evaluated 2*N times (N being the number of times a single xmake command will process a xmake.lua), which is fast for most project but becomes time consumming on bigger projects having a lot of lua files included by a xmake.lua
  2. it resets xmake configuration to the one set when generating the vsxmake project (I sometime work with xmake in commandline and change configuration, but recompiling from VS breaks the config)
  3. VS is slow to launch new processes(?)

Describe the solution you'd like

Having the xmake build/clean tasks take a config parameter that it would apply temporarily (not saving it/restoring old config on exit) and changing vsxmake generator to use it would fix those issues, giving also the possibility to test a small build with a specific config without overriding the whole configuration.

Something like:
xmake build --configs={mode="debug", foo="bar"}

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions