File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,6 +320,9 @@ def _configure_native_gcc(self):
320320 self .conf_info .define (
321321 "tools.cmake.cmaketoolchain:system_name" , "Windows" )
322322
323+ # Tell CMake that native binaries can run on this machine
324+ self .conf_info .define ("tools.build.cross_building:can_run" , True )
325+
323326 # CMake extra variables for native GCC
324327 self .conf_info .define ("tools.cmake.cmaketoolchain:extra_variables" , {
325328 "CMAKE_C_COMPILER" : "gcc" ,
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ project(demo LANGUAGES CXX)
77
88add_executable (demo main.cpp )
99
10- if (NOT ${CMAKE_CROSSCOMPILING} )
11- message (STATUS "🚀 Will launch demo after building" )
12- add_custom_target (run_demo ALL DEPENDS demo COMMAND demo )
13- else ()
10+ if (${CMAKE_CROSSCOMPILING} )
1411 message (STATUS "⏭️ Binary is not native, skipping build" )
15- endif (NOT ${CMAKE_CROSSCOMPILING} )
12+ else ()
13+ message (STATUS "🚀 Will launch demo after building" )
14+ endif (${CMAKE_CROSSCOMPILING} )
15+
16+ add_custom_target (run_demo ALL DEPENDS demo COMMAND demo )
1617
1718add_custom_target (copy_compile_commands ALL
1819 COMMAND ${CMAKE_COMMAND} -E copy_if_different
You can’t perform that action at this time.
0 commit comments