Browse Source

cmake: Generate correct inline source listings in asm output

Manually provide a source path prefix to objdump
Yuri D'Elia 1 year ago
parent
commit
4412881439
1 changed files with 1 additions and 1 deletions
  1. 1 1
      CMakeLists.txt

+ 1 - 1
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
     )