From 4412881439230b9b3e98ffdf15d442eaff12efa1 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 1 Oct 2022 23:17:52 +0200 Subject: [PATCH] cmake: Generate correct inline source listings in asm output Manually provide a source path prefix to objdump --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5134de875..ff7667fa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,7 +321,7 @@ function(add_base_binary variant_name) # produce ASM listing. Note we also specify the .map as a byproduct so it gets cleaned # because link_options doesn't have a "generated outputs" feature. add_custom_command( - TARGET ${variant_name} POST_BUILD COMMAND ${CMAKE_OBJDUMP} -CSd ${variant_name} > ${variant_name}.asm + TARGET ${variant_name} POST_BUILD COMMAND ${CMAKE_OBJDUMP} --prefix ${CMAKE_SOURCE_DIR} -CSd ${variant_name} > ${variant_name}.asm BYPRODUCTS ${variant_name}.asm ${variant_name}.map )