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

add setupOptions configuration, useful for passing --cross-file to meson setup #94

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
],
"description": "Specify the list of configuration options used for Meson configuration."
},
"mesonbuild.setupOptions": {
"type": "array",
"default": [],
"description": "Specify the list of setup options used for Meson setup. Can be used to specify a cross file (use --cross-file=FILE)."
},
"mesonbuild.mesonPath": {
"type": "string",
"default": "meson",
Expand Down
5 changes: 3 additions & 2 deletions src/meson/runners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function runMesonConfigure(source: string, build: string) {
});

const configureOpts = extensionConfiguration("configureOptions");
const setupOpts = extensionConfiguration("setupOptions");

if (await checkMesonIsConfigured(build)) {
progress.report({
Expand All @@ -40,15 +41,15 @@ export async function runMesonConfigure(source: string, build: string) {
progress.report({ message: "Reconfiguring build...", increment: 60 });

// Note "setup --reconfigure" needs to be run from the root.
await exec(extensionConfiguration("mesonPath"), ["setup", "--reconfigure", build],
await exec(extensionConfiguration("mesonPath"), ["setup", "--reconfigure", ...setupOpts, build],
{ cwd: source });
} else {
progress.report({
message: `Configuring Meson into ${relative(source, build)}...`
});

const { stdout, stderr } = await exec(
extensionConfiguration("mesonPath"), ["setup", ...configureOpts, build],
extensionConfiguration("mesonPath"), ["setup", ...configureOpts, ...setupOpts, build],
{ cwd: source });

getOutputChannel().appendLine(stdout);
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type LinterConfiguration = {
export interface ExtensionConfiguration {
configureOnOpen: boolean | "ask";
configureOptions: string[];
setupOptions: string[];
buildFolder: string;
mesonPath: string;
muonPath: string;
Expand Down