From 15097605cf8212ac911335d9cfca60c874a2d596 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 3 Jun 2024 22:14:45 +0700 Subject: [PATCH 1/5] Block building in wrong command prompt --- CMakePresets.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index a39595cbda6..5182b880612 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -19,6 +19,11 @@ "architecture": { "strategy": "external", "value": "x86" + }, + "condition": { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "x86" } }, { @@ -28,6 +33,11 @@ "architecture": { "strategy": "external", "value": "x64" + }, + "condition": { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "x64" } }, { @@ -38,6 +48,11 @@ "strategy": "external", "value": "ARM" }, + "condition": { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "ARM" + }, "cacheVariables": { "TESTS_BUILD_ONLY": true } @@ -50,6 +65,11 @@ "strategy": "external", "value": "ARM64" }, + "condition": { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "ARM64" + }, "cacheVariables": { "TESTS_BUILD_ONLY": true } @@ -62,6 +82,11 @@ "strategy": "external", "value": "ARM64EC" }, + "condition": { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "ARM64EC" + }, "cacheVariables": { "TESTS_BUILD_ONLY": true, "VCLIBS_TARGET_ARCHITECTURE": "ARM64EC" From b5655a7cd154204ffb536ac7c8b54d1ccdb5bb93 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 5 Jun 2024 21:48:22 +0700 Subject: [PATCH 2/5] allow empty "Platform" --- CMakePresets.json | 80 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 5182b880612..aa620a5270a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -21,9 +21,19 @@ "value": "x86" }, "condition": { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "x86" + "type": "anyOf", + "conditions": [ + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "x86" + }, + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "" + } + ] } }, { @@ -35,9 +45,19 @@ "value": "x64" }, "condition": { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "x64" + "type": "anyOf", + "conditions": [ + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "x64" + }, + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "" + } + ] } }, { @@ -49,9 +69,19 @@ "value": "ARM" }, "condition": { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "ARM" + "type": "anyOf", + "conditions": [ + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "ARM" + }, + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "" + } + ] }, "cacheVariables": { "TESTS_BUILD_ONLY": true @@ -66,9 +96,19 @@ "value": "ARM64" }, "condition": { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "ARM64" + "type": "anyOf", + "conditions": [ + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "ARM64" + }, + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "" + } + ] }, "cacheVariables": { "TESTS_BUILD_ONLY": true @@ -83,9 +123,19 @@ "value": "ARM64EC" }, "condition": { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "ARM64EC" + "type": "anyOf", + "conditions": [ + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "ARM64EC" + }, + { + "type": "equals", + "lhs": "$env{Platform}", + "rhs": "" + } + ] }, "cacheVariables": { "TESTS_BUILD_ONLY": true, From 6288b9ad0575dccb9b5220de48cf0c7160733b20 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 6 Jun 2024 08:06:13 +0700 Subject: [PATCH 3/5] format the json. --- CMakePresets.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index aa620a5270a..1f0bb2ee2f6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -23,7 +23,7 @@ "condition": { "type": "anyOf", "conditions": [ - { + { "type": "equals", "lhs": "$env{Platform}", "rhs": "x86" @@ -47,7 +47,7 @@ "condition": { "type": "anyOf", "conditions": [ - { + { "type": "equals", "lhs": "$env{Platform}", "rhs": "x64" @@ -71,7 +71,7 @@ "condition": { "type": "anyOf", "conditions": [ - { + { "type": "equals", "lhs": "$env{Platform}", "rhs": "ARM" @@ -98,7 +98,7 @@ "condition": { "type": "anyOf", "conditions": [ - { + { "type": "equals", "lhs": "$env{Platform}", "rhs": "ARM64" @@ -125,7 +125,7 @@ "condition": { "type": "anyOf", "conditions": [ - { + { "type": "equals", "lhs": "$env{Platform}", "rhs": "ARM64EC" From 6f4c33324d47de71b926dfa5645a20eade0f332a Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 9 Jun 2024 12:21:38 +0700 Subject: [PATCH 4/5] correct "Platform" for ARM/ARM64 command prompts --- CMakePresets.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 1f0bb2ee2f6..b4e2eb640cf 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -74,7 +74,7 @@ { "type": "equals", "lhs": "$env{Platform}", - "rhs": "ARM" + "rhs": "arm" }, { "type": "equals", @@ -101,7 +101,7 @@ { "type": "equals", "lhs": "$env{Platform}", - "rhs": "ARM64" + "rhs": "arm64" }, { "type": "equals", @@ -128,7 +128,7 @@ { "type": "equals", "lhs": "$env{Platform}", - "rhs": "ARM64EC" + "rhs": "arm64" }, { "type": "equals", From d93839d3876885b3c1d52caf191e1740ee198573 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 13 Jun 2024 07:49:28 -0700 Subject: [PATCH 5/5] Simplify with "inList". --- CMakePresets.json | 85 ++++++++++++++--------------------------------- 1 file changed, 25 insertions(+), 60 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index b4e2eb640cf..1ddb274aec3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -21,18 +21,11 @@ "value": "x86" }, "condition": { - "type": "anyOf", - "conditions": [ - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "x86" - }, - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "" - } + "type": "inList", + "string": "$env{Platform}", + "list": [ + "x86", + "" ] } }, @@ -45,18 +38,11 @@ "value": "x64" }, "condition": { - "type": "anyOf", - "conditions": [ - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "x64" - }, - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "" - } + "type": "inList", + "string": "$env{Platform}", + "list": [ + "x64", + "" ] } }, @@ -69,18 +55,11 @@ "value": "ARM" }, "condition": { - "type": "anyOf", - "conditions": [ - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "arm" - }, - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "" - } + "type": "inList", + "string": "$env{Platform}", + "list": [ + "arm", + "" ] }, "cacheVariables": { @@ -96,18 +75,11 @@ "value": "ARM64" }, "condition": { - "type": "anyOf", - "conditions": [ - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "arm64" - }, - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "" - } + "type": "inList", + "string": "$env{Platform}", + "list": [ + "arm64", + "" ] }, "cacheVariables": { @@ -123,18 +95,11 @@ "value": "ARM64EC" }, "condition": { - "type": "anyOf", - "conditions": [ - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "arm64" - }, - { - "type": "equals", - "lhs": "$env{Platform}", - "rhs": "" - } + "type": "inList", + "string": "$env{Platform}", + "list": [ + "arm64", + "" ] }, "cacheVariables": {