From 5539047d938e489dc2d4b909ab0fe724b204ea29 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 23 Nov 2017 19:56:04 +0200 Subject: [PATCH] cmake: qemu: Restore QEMU_INSTANCE option handling. QEMU_INSTANCE should be a parameter to *make*, not cmake, so people can run few instances of the same sample without building each of them separately in separate dirs. Signed-off-by: Paul Sokolovsky --- cmake/qemu/CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/qemu/CMakeLists.txt b/cmake/qemu/CMakeLists.txt index 36165148771..7928db272cb 100644 --- a/cmake/qemu/CMakeLists.txt +++ b/cmake/qemu/CMakeLists.txt @@ -1,10 +1,6 @@ if(EMU_PLATFORM) # TODO: Support more emulators - # QEMU_INSTANCE is a command line argument to make. By appending the - # instance name to the pid file we can easily run more instances of - # the same sample. - set(qemu_targets run debugserver @@ -57,8 +53,11 @@ if(EMU_PLATFORM) -pidfile qemu-${target}.pid ) else() + # QEMU_INSTANCE is a command line argument to *make* (not cmake). By + # appending the instance name to the pid file we can easily run more + # instances of the same sample. list(APPEND MORE_FLAGS_FOR_${target} - -serial unix:/tmp/slip.sock${QEMU_INSTANCE} + -serial unix:/tmp/slip.sock\${QEMU_INSTANCE} ) endif() endforeach() @@ -150,7 +149,7 @@ if(EMU_PLATFORM) COMMAND ${QEMU} ${QEMU_FLAGS_${ARCH}} - -pidfile qemu${QEMU_INSTANCE}.pid + -pidfile qemu\${QEMU_INSTANCE}.pid ${QEMU_FLAGS} ${QEMU_EXTRA_FLAGS} ${MORE_FLAGS_FOR_${target}}