diff --git a/backends/xnnpack/CMakeLists.txt b/backends/xnnpack/CMakeLists.txt index 51abb4f2356..5e2bc3d3f9b 100644 --- a/backends/xnnpack/CMakeLists.txt +++ b/backends/xnnpack/CMakeLists.txt @@ -59,7 +59,7 @@ foreach(fbs_file ${_xnnpack_schema__srcs}) ) endforeach() -if(WIN32) +if(WIN32 AND NOT CMAKE_CROSSCOMPILING) set(MV_COMMAND powershell -Command "Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs}" diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index ff61a36e6fe..58a5ba657cb 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -49,7 +49,7 @@ ExternalProject_Add( ExternalProject_Get_Property(flatbuffers_external_project INSTALL_DIR) add_executable(flatc IMPORTED GLOBAL) add_dependencies(flatc flatbuffers_external_project) -if(WIN32) +if(WIN32 AND NOT CMAKE_CROSSCOMPILING) # flatbuffers does not use CMAKE_BUILD_TYPE. Internally, the build forces Release # config, but from CMake's perspective the build type is always Debug. set_target_properties(flatc PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/bin/flatc.exe) @@ -101,7 +101,7 @@ file(REMOVE_RECURSE ${PROJECT_SOURCE_DIR}/third-party/flatcc/lib) ExternalProject_Get_Property(flatcc_external_project INSTALL_DIR) add_executable(flatcc_cli IMPORTED GLOBAL) add_dependencies(flatcc_cli flatcc_external_project) -if(WIN32) +if(WIN32 AND NOT CMAKE_CROSSCOMPILING) set_target_properties(flatcc_cli PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/bin/flatcc.exe) else() set_target_properties(flatcc_cli PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/bin/flatcc)