Fast-DDS icon indicating copy to clipboard operation
Fast-DDS copied to clipboard

try_run() causes cmake error in cross-compiling mode

Open Cheney-W opened this issue 1 year ago • 0 comments

Is there an already existing issue for this?

  • [X] I have searched the existing issues

Expected behavior

No error.

Current behavior

CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately: SM_RUN_RESULT (advanced) SM_RUN_RESULT__TRYRUN_OUTPUT (advanced)

Steps to reproduce

  1. git clone https://github.com/Cheney-W/vcpkg.git
  2. git checkout Dev/Cheney/36368
  3. .\bootstrap-vcpkg.bat
  4. .\vcpkg.exe install fastrtps:arm64-windows

Fast DDS version/commit

https://github.com/eProsima/Fast-DDS/releases/tag/v2.13.1

Platform/Architecture

Windows 10 Visual Studio 2019

Transport layer

Default configuration, UDPv4 & SHM

Additional context

After add below codes into the https://github.com/eProsima/Fast-DDS/blob/master/src/cpp/CMakeLists.txt:

set(SM_RUN_RESULT 0 CACHE INTERNAL "")
set(SM_RUN_RESULT__TRYRUN_OUTPUT "" CACHE INTERNAL "")

cmake failed with a new error:

CMake Error at src/cpp/CMakeLists.txt:420 (string):
  string sub-command STRIP requires two arguments

The issue is that after executing the try_run command, the value of RUN_OUTPUT_VARIABLE is empty.

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

Cheney-W avatar Jan 26 '24 10:01 Cheney-W