Convert CMakeSettings.json to CMakePresets.json for coreclr (#89513)
authorHuo Yaoyuan <huoyaoyuan@hotmail.com>
Mon, 7 Aug 2023 17:08:23 +0000 (01:08 +0800)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 17:08:23 +0000 (10:08 -0700)
.gitignore
src/coreclr/CMakePresets.json [new file with mode: 0644]
src/coreclr/CMakeSettings.json [deleted file]

index b126fbe..71943be 100644 (file)
@@ -326,6 +326,7 @@ Vagrantfile
 CMakeFiles/
 cmake_install.cmake
 CMakeCache.txt
+CMakeUserPresets.json
 
 # Cross compilation
 cross/rootfs/*
diff --git a/src/coreclr/CMakePresets.json b/src/coreclr/CMakePresets.json
new file mode 100644 (file)
index 0000000..261d4c3
--- /dev/null
@@ -0,0 +1,169 @@
+{
+  "version": 2,
+  "cmakeMinimumRequired": {
+    "major": 3,
+    "minor": 20
+  },
+  "configurePresets": [
+    {
+      "name": "base",
+      "hidden": true,
+      "generator": "Ninja",
+      "binaryDir": "${sourceDir}/../../artifacts/obj/coreclr/${presetName}",
+      "cacheVariables": {
+        "CMAKE_INSTALL_PREFIX": "${sourceDir}/../../artifacts/bin/coreclr/${presetName}"
+      }
+    },
+    {
+      "name": "windows-base",
+      "hidden": true,
+      "inherits": "base",
+      "cacheVariables": {
+        "CLR_CMAKE_TARGET_OS": "windows",
+        "CLI_CMAKE_FALLBACK_OS": "win10"
+      },
+      "vendor": {
+        "microsoft.com/VisualStudioSettings/CMake/1.0": {
+          "hostOS": [
+            "Windows"
+          ]
+        }
+      }
+    },
+    {
+      "name": "Debug",
+      "hidden": true,
+      "cacheVariables": {
+        "CMAKE_BUILD_TYPE": "Debug"
+      }
+    },
+    {
+      "name": "Release",
+      "hidden": true,
+      "cacheVariables": {
+        "CMAKE_BUILD_TYPE": "Release"
+      }
+    },
+    {
+      "name": "Checked",
+      "hidden": true,
+      "cacheVariables": {
+        "CMAKE_BUILD_TYPE": "Checked"
+      }
+    },
+    {
+      "name": "x64",
+      "hidden": true,
+      "architecture": {
+        "value": "x64",
+        "strategy": "external"
+      },
+      "cacheVariables": {
+        "CLR_CMAKE_HOST_ARCH": "x64"
+      }
+    },
+    {
+      "name": "x86",
+      "hidden": true,
+      "architecture": {
+        "value": "x86",
+        "strategy": "external"
+      },
+      "cacheVariables": {
+        "CLR_CMAKE_HOST_ARCH": "x86"
+      }
+    },
+    {
+      "name": "ARM64",
+      "hidden": true,
+      "architecture": {
+        "value": "ARM64",
+        "strategy": "external"
+      },
+      "cacheVariables": {
+        "CLR_CMAKE_HOST_ARCH": "ARM64"
+      }
+    },
+    {
+      "name": "windows.x64.Debug",
+      "displayName": "windows.x64.Debug",
+      "inherits": [
+        "windows-base",
+        "Debug",
+        "x64"
+      ]
+    },
+    {
+      "name": "windows.x64.Release",
+      "displayName": "windows.x64.Release",
+      "inherits": [
+        "windows-base",
+        "Release",
+        "x64"
+      ]
+    },
+    {
+      "name": "windows.x64.Checked",
+      "displayName": "windows.x64.Checked",
+      "inherits": [
+        "windows-base",
+        "Checked",
+        "x64"
+      ]
+    },
+    {
+      "name": "windows.x86.Debug",
+      "displayName": "windows.x86.Debug",
+      "inherits": [
+        "windows-base",
+        "Debug",
+        "x86"
+      ]
+    },
+    {
+      "name": "windows.x86.Release",
+      "displayName": "windows.x86.Release",
+      "inherits": [
+        "windows-base",
+        "Release",
+        "x86"
+      ]
+    },
+    {
+      "name": "windows.x86.Checked",
+      "displayName": "windows.x86.Checked",
+      "inherits": [
+        "windows-base",
+        "Checked",
+        "x86"
+      ]
+    },
+    {
+      "name": "windows.arm64.Debug",
+      "displayName": "windows.arm64.Debug",
+      "inherits": [
+        "windows-base",
+        "Debug",
+        "ARM64"
+      ]
+    },
+    {
+      "name": "windows.arm64.Release",
+      "displayName": "windows.arm64.Release",
+      "inherits": [
+        "windows-base",
+        "Release",
+        "ARM64"
+      ]
+    },
+    {
+      "name": "windows.arm64.Checked",
+      "displayName": "windows.arm64.Checked",
+      "inherits": [
+        "windows-base",
+        "Checked",
+        "ARM64"
+      ]
+    }
+  ]
+}
diff --git a/src/coreclr/CMakeSettings.json b/src/coreclr/CMakeSettings.json
deleted file mode 100644 (file)
index dc56983..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-{
-  "environments": [
-    {
-      "artifactsBin": "${projectDir}\\..\\..\\artifacts\\bin\\coreclr",
-      "artifactsObj": "${projectDir}\\..\\..\\artifacts\\obj\\coreclr"
-    }
-  ],
-  "configurations": [
-    {
-      "name": "windows.x64.Debug",
-      "generator": "Ninja",
-      "configurationType": "Debug",
-      "buildRoot": "${env.artifactsObj}\\${name}",
-      "installRoot": "${env.artifactsBin}\\${name}",
-      "cmakeCommandArgs": "-DCLR_CMAKE_HOST_ARCH=x64 -DCLI_CMAKE_FALLBACK_OS=win",
-      "buildCommandArgs": "",
-      "ctestCommandArgs": "",
-      "inheritEnvironments": [ "msvc_x64" ]
-    },
-    {
-      "name": "windows.x64.Release",
-      "generator": "Ninja",
-      "configurationType": "Release",
-      "buildRoot": "${env.artifactsObj}\\${name}",
-      "installRoot": "${env.artifactsBin}\\${name}",
-      "cmakeCommandArgs": "-DCLR_CMAKE_HOST_ARCH=x64 -DCLI_CMAKE_FALLBACK_OS=win",
-      "buildCommandArgs": "",
-      "ctestCommandArgs": "",
-      "inheritEnvironments": [ "msvc_x64" ]
-    },
-    {
-      "name": "windows.x86.Debug",
-      "generator": "Ninja",
-      "configurationType": "Debug",
-      "buildRoot": "${env.artifactsObj}\\${name}",
-      "installRoot": "${env.artifactsBin}\\${name}",
-      "cmakeCommandArgs": "-DCLR_CMAKE_HOST_ARCH=x86 -DCLI_CMAKE_FALLBACK_OS=win",
-      "buildCommandArgs": "",
-      "ctestCommandArgs": "",
-      "inheritEnvironments": [ "msvc_x86" ]
-    },
-    {
-      "name": "windows.x86.Release",
-      "generator": "Ninja",
-      "configurationType": "Release",
-      "buildRoot": "${env.artifactsObj}\\${name}",
-      "installRoot": "${env.artifactsBin}\\${name}",
-      "cmakeCommandArgs": "-DCLR_CMAKE_HOST_ARCH=x86 -DCLI_CMAKE_FALLBACK_OS=win",
-      "buildCommandArgs": "",
-      "ctestCommandArgs": "",
-      "inheritEnvironments": [ "msvc_x86" ]
-    },
-    {
-      "name": "windows.arm64.Debug",
-      "generator": "Ninja",
-      "configurationType": "Debug",
-      "buildRoot": "${env.artifactsObj}\\${name}",
-      "installRoot": "${env.artifactsBin}\\${name}",
-      "cmakeCommandArgs": "-DCLR_CMAKE_HOST_ARCH=arm64 -DCLI_CMAKE_FALLBACK_OS=win",
-      "buildCommandArgs": "",
-      "ctestCommandArgs": "",
-      "inheritEnvironments": [ "msvc_arm64" ],
-      "variables": []
-    },
-    {
-      "name": "windows.arm64.Release",
-      "generator": "Ninja",
-      "configurationType": "Release",
-      "buildRoot": "${env.artifactsObj}\\${name}",
-      "installRoot": "${env.artifactsBin}\\${name}",
-      "cmakeCommandArgs": "-DCLR_CMAKE_HOST_ARCH=arm64 -DCLI_CMAKE_FALLBACK_OS=win",
-      "buildCommandArgs": "",
-      "ctestCommandArgs": "",
-      "inheritEnvironments": [ "msvc_arm64" ],
-      "variables": []
-    }
-  ]
-}