From 7b48d2bc28733ad4d4fe029b1184491130229435 Mon Sep 17 00:00:00 2001 From: Morgan Diepart Date: Tue, 16 Jan 2024 23:34:14 +0100 Subject: [PATCH] Fix meson setup for windows cp does not exist on windows but xcopy does. --- meson.build | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 75b57e88..d84da943 100644 --- a/meson.build +++ b/meson.build @@ -707,12 +707,25 @@ foreach t : targets # ttwrplus is a Zephyr target, we compile it using west and package it in uf2 format if name == 'openrtx_ttwrplus' - txt = custom_target('Copy CMakeLists.txt', - input : 'CMakeLists.txt', - output : 'CMakeLists.txt', - command : ['cp', '@INPUT@', '@OUTPUT@'], - install : false, - build_by_default : true) + if build_machine.system() == 'linux' + + txt = custom_target('Copy CMakeLists.txt', + input : 'CMakeLists.txt', + output : 'CMakeLists.txt', + command : ['cp', '@INPUT@', '@OUTPUT@'], + install : false, + build_by_default : true) + + elif build_machine.system() == 'windows' + + txt = custom_target('Copy CMakeLists.txt', + input : 'CMakeLists.txt', + output : 'CMakeLists.txt', + command : ['xcopy', '@INPUT@', '@OUTPUT@'], + install : false, + build_by_default : true) + endif + bin = custom_target(name, input : txt,