aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGyorgy Szing <Gyorgy.Szing@arm.com>2021-06-30 22:41:11 +0000
committerGy├Ârgy Szing <gyorgy.szing@arm.com>2021-07-01 01:01:50 +0200
commitcd3241a5b189c74264d06e6413397eaa3b9dca81 (patch)
treec1f087d3e9e30025f2fdbc8b35cb88e3f4e69ef4
parent2f6671337c57254812e0694283b457e8497b38b0 (diff)
downloadtrusted-services-cd3241a5b189c74264d06e6413397eaa3b9dca81.tar.gz
Fix: nanopb files always generated
The dependencies of nanopb generation targets are incorrect and as a result the project is re-built even if there are no changed files. This patch corrects the dependencies and eliminates the unnecessary rebuilds. Change-Id: I52b07fcb868594994e2b61f4beb419a9928b8db2 Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
-rw-r--r--external/nanopb/nanopb.cmake9
1 files changed, 4 insertions, 5 deletions
diff --git a/external/nanopb/nanopb.cmake b/external/nanopb/nanopb.cmake
index eda00e4..195e741 100644
--- a/external/nanopb/nanopb.cmake
+++ b/external/nanopb/nanopb.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -209,11 +209,11 @@ function(protobuf_generate)
set(_nanopb_fake_file "nanopb_generate_ff_${PARAMS_TGT}")
if (NOT TARGET "${_nanopb_target}")
+ #Tell cmake the dependency (source) file is fake.
+ set_source_files_properties("${_nanopb_fake_file}" PROPERTIES SYMBOLIC "true")
#Create a custom target which depends on a "fake" file.
add_custom_target("${_nanopb_target}"
DEPENDS "${_nanopb_fake_file}")
- #Tell cmake the dependency (source) file is fake.
- set_source_files_properties("${_nanopb_fake_file}" PROPERTIES SYMBOLIC "true")
#Add a cutom command to the target to create output directory.
add_custom_command(OUTPUT "${_nanopb_fake_file}"
COMMAND ${CMAKE_COMMAND} -E make_directory ${_OUT_DIR_BASE}
@@ -225,8 +225,7 @@ function(protobuf_generate)
endif()
#Append a protobuf generator command to the nanopb_generate target.
- add_custom_command(OUTPUT "${_nanopb_fake_file}" "${_OUT_C}" "${_OUT_H}"
- APPEND
+ add_custom_command(OUTPUT "${_OUT_C}" "${_OUT_H}"
COMMAND ${Python3_EXECUTABLE} ${NANOPB_GENERATOR_PATH}
-I ${PARAMS_BASE_DIR}
-D ${_OUT_DIR_BASE}