From 62cb2757b9326d8a3b48a92ee3093373e6d848b6 Mon Sep 17 00:00:00 2001 From: James Benton Date: Thu, 31 May 2018 10:30:58 +0100 Subject: [PATCH] wut_add_exports: Use target name when generating exports. This helps keep the filename unique. --- share/wut.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/share/wut.cmake b/share/wut.cmake index 0ca96ca..a15c6a3 100644 --- a/share/wut.cmake +++ b/share/wut.cmake @@ -27,13 +27,15 @@ macro(wut_add_exports target exports_file) set(RPL_EXPORTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${exports_file}") endif() - add_custom_command( - OUTPUT rpl_exports.s - COMMAND ${WUT_RPLEXPORTGEN} ${RPL_EXPORTS_FILE} rpl_exports.s - DEPENDS ${RPL_EXPORTS_FILE}) - target_sources(${target} PRIVATE rpl_exports.s) + set(RPL_EXPORT_GEN_OUTPUT ${target}_exports.s) - set_source_files_properties(rpl_exports.s PROPERTIES LANGUAGE C) + add_custom_command( + OUTPUT ${RPL_EXPORT_GEN_OUTPUT} + COMMAND ${WUT_RPLEXPORTGEN} ${RPL_EXPORTS_FILE} ${RPL_EXPORT_GEN_OUTPUT} + DEPENDS ${RPL_EXPORTS_FILE}) + target_sources(${target} PRIVATE ${RPL_EXPORT_GEN_OUTPUT}) + + set_source_files_properties(${RPL_EXPORT_GEN_OUTPUT} PROPERTIES LANGUAGE C) endmacro(wut_add_exports) function(wut_create_rpl target source)