-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
fix cmake & mingw detect cross-compilation on windows #5888
Conversation
star-hengxing
commented
Nov 26, 2024
看不懂为啥要这么改? win 上 mingw 编译,需要置空这个不能显式设置 windows?那为啥其他这么多包的 win mingw 编译 都没问题呢,就这个包不行。 如果只是单个包的问题,应该这个包的 on_install 里单独去调整 |
cmake_minimum_required(VERSION 3.15.0)
project(test LANGUAGES CXX)
include(CheckCXXSourceRuns)
check_cxx_source_runs(
"int main() {}"
HELLO
) -- The CXX compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/star/scoop/apps/w64devkit/current/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HELLO
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
HELLO_EXITCODE (advanced)
For details see A:/project/xmake/test/build/cmake/TryRunResults.cmake
-- Performing Test HELLO - Failed
-- Configuring incomplete, errors occurred!
error: execv(cmake -B build/cmake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_COMPILER=g++ -G Ninja) failed(1) |
I don’t understand why it needs to be changed like this? When compiling with mingw on win, you need to leave this blank and cannot explicitly set windows? Then why do so many other packages have no problem compiling with win mingw, but only this package does not work? If it is just a problem with a single package, it should be adjusted separately in the on_install of this package. |
Okay, this behavior is weird too. |