按照https://learn.microsoft.com/en-us/windows/arm/arm64ec-build中的说明,我可以使用VS2022构建一个简单的“hello world”CMake项目。
问题是,如果我尝试在GitHub上构建操作,我会得到:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
字符串
我的yml很简单
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
buildWindowsARM64EC:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Do stuff
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64
cmake -B ${{github.workspace}}/build --preset arm64ec
cmake --build ${{github.workspace}}/build --config Release
shell: cmd
型
CMakePresets.json也很简单
{
"version": 5,
"configurePresets": [
{
"name": "base",
"hidden": true,
"generator": "Visual Studio 17 2022"
},
{
"name": "arm64ec",
"inherits": "base",
"displayName": "arm64ec",
"architecture": {
"value": "arm64ec",
"strategy": "set"
}
}
]
}
型
CMakeLists.txt:
cmake_minimum_required (VERSION 3.15)
project ("hello")
set(CMAKE_CXX_STANDARD 17)
set(Sources
main.cpp)
add_executable (${PROJECT_NAME} ${Sources})
型
我猜我错过了一个PATH配置或类似的东西,但尽管多次迭代,我似乎不能得到任何接近它的工作。
1条答案
按热度按时间zpqajqem1#
最终,解决方案非常简单。
基本上我需要针对不同的SDK。
我添加了-DCMAKE_SYSTEM_VERSION=10,一切正常
YML现在只是:
字符串
这样,它就像预期的那样工作了:
型