Skip to content

[cmake] Fix cross-build failure#1164

Closed
JackBoosY wants to merge 1 commit intoopenscenegraph:masterfrom
JackBoosY:dev/jack/fix-cmake-cross-build
Closed

[cmake] Fix cross-build failure#1164
JackBoosY wants to merge 1 commit intoopenscenegraph:masterfrom
JackBoosY:dev/jack/fix-cmake-cross-build

Conversation

@JackBoosY
Copy link
Copy Markdown

When I cross-build osg for arm64-windows with x64-windows, I got the following cmake error message:

CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED_EXITCODE (advanced)
   _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED_EXITCODE__TRYRUN_OUTPUT (advanced)
For details see D:/buildtrees/osg/arm64-windows-rel/TryRunResults.cmake

According to the cmake code generated by cmake automaticly, add the same code before call CHECK_CXX_SOURCE_RUNS.

cmake version: 3.24
osg version: 3.6.5
OS version: Windows 10
compiler version: Visual Studio 2017

@dg0yt
Copy link
Copy Markdown

dg0yt commented Sep 9, 2022

IMO this PR is completely invalid.
However, the original problem is valid: all uses of try_run or check_cxx_source_runs are a barrier for cross builds.
https://github.com/openscenegraph/OpenSceneGraph/search?q=CHECK_CXX_SOURCE_RUNS

@JackBoosY JackBoosY closed this Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants