mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Generate PSA constant names in CMake build dir
This commit modifies the generate_psa_constants.py script to take as input argument the location of where to write the psa_constant_names_generated.c file. For make-based build system, this commit does not change anything. For CMake build system, this commit modifies the generation location of that file to be inside the build directory and include it from there in psa_constant_names.c Fix #3365 Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
This commit is contained in:
@ -8,6 +8,7 @@ of that program.
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
OUTPUT_TEMPLATE = '''\
|
||||
/* Automatically generated by generate_psa_constant.py. DO NOT EDIT. */
|
||||
@ -395,6 +396,8 @@ def generate_psa_constants(header_file_names, output_file_name):
|
||||
if __name__ == '__main__':
|
||||
if not os.path.isdir('programs') and os.path.isdir('../programs'):
|
||||
os.chdir('..')
|
||||
# Allow to change the directory where psa_constant_names_generated.c is written to.
|
||||
OUTPUT_FILE_DIR = sys.argv[1] if len(sys.argv) == 2 else "programs/psa"
|
||||
generate_psa_constants(['include/psa/crypto_values.h',
|
||||
'include/psa/crypto_extra.h'],
|
||||
'programs/psa/psa_constant_names_generated.c')
|
||||
OUTPUT_FILE_DIR + '/psa_constant_names_generated.c')
|
||||
|
Reference in New Issue
Block a user