From d9eee3b417c2e8f63dd10d835ab9a9472242c2ed Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Fri, 2 Nov 2018 10:45:36 +0000 Subject: [PATCH] Add library as valid header file location The persistent key implementation will be split across multiple files as it will eventually be implementing multiple storage backends. As these internal functions will need to be callable by other files, we will add the headers in the library folder. This commit adds this include location to the necessary scripts. For tests, the library is added as an include location as testing on-target with Mbed OS is not possible with paths including ".." --- CMakeLists.txt | 1 + crypto/tests/Makefile | 2 +- scripts/generate_visualc_files.pl | 8 +++++--- tests/Makefile | 2 +- tests/scripts/list-identifiers.sh | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99bf31f1f6..11efd87e44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,6 +168,7 @@ else() endif() include_directories(include/) +include_directories(library/) if(ENABLE_ZLIB_SUPPORT) find_package(ZLIB) diff --git a/crypto/tests/Makefile b/crypto/tests/Makefile index f76c1c0f82..b44b470a36 100644 --- a/crypto/tests/Makefile +++ b/crypto/tests/Makefile @@ -1,4 +1,4 @@ -CFLAGS ?= -O2 -I../include +CFLAGS ?= -O2 -I../include -I../library WARNING_CFLAGS ?= \ -Werror -Wall -Wextra \ -Wno-unused-function \ diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl index 488a5beb69..d8825eed55 100755 --- a/scripts/generate_visualc_files.pl +++ b/scripts/generate_visualc_files.pl @@ -133,10 +133,11 @@ sub gen_entry_list { } sub gen_main_file { - my ($mbedtls_headers, $psa_headers, $sources, $hdr_tpl, $src_tpl, $main_tpl, $main_out) = @_; + my ($mbedtls_headers, $psa_headers, $source_headers, $sources, $hdr_tpl, $src_tpl, $main_tpl, $main_out) = @_; my $header_entries = gen_entry_list( $hdr_tpl, @$mbedtls_headers ); $header_entries .= gen_entry_list( $hdr_tpl, @$psa_headers ); + $header_entries .= gen_entry_list( $hdr_tpl, @$source_headers ); my $source_entries = gen_entry_list( $src_tpl, @$sources ); my $out = slurp_file( $main_tpl ); @@ -192,6 +193,7 @@ sub main { my @app_list = get_app_list(); my @mbedtls_headers = <$mbedtls_header_dir/*.h>; my @psa_headers = <$psa_header_dir/*.h>; + my @source_headers = <$source_dir/*.h>; my @sources = <$source_dir/*.c>; map { s!/!\\!g } @mbedtls_headers; map { s!/!\\!g } @psa_headers; @@ -199,8 +201,8 @@ sub main { gen_app_files( @app_list ); - gen_main_file( \@mbedtls_headers, \@psa_headers, \@sources, - $vsx_hdr_tpl, $vsx_src_tpl, + gen_main_file( \@mbedtls_headers, \@psa_headers, \@source_headers, + \@sources, $vsx_hdr_tpl, $vsx_src_tpl, $vsx_main_tpl_file, $vsx_main_file ); gen_vsx_solution( @app_list ); diff --git a/tests/Makefile b/tests/Makefile index 889d2a7da6..f5cafe5852 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -6,7 +6,7 @@ CFLAGS ?= -O2 WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value LDFLAGS ?= -LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64 +LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -I../library -D_FILE_OFFSET_BITS=64 LOCAL_LDFLAGS = -L../library \ -lmbedtls$(SHARED_SUFFIX) \ -lmbedx509$(SHARED_SUFFIX) \ diff --git a/tests/scripts/list-identifiers.sh b/tests/scripts/list-identifiers.sh index 89daa68c70..ccd488c2e6 100755 --- a/tests/scripts/list-identifiers.sh +++ b/tests/scripts/list-identifiers.sh @@ -7,7 +7,7 @@ if [ -d include/mbedtls ]; then :; else exit 1 fi -HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h|bn_mul' ) +HEADERS=$( ls include/mbedtls/*.h include/psa/*.h library/*.h | egrep -v 'compat-1\.3\.h|bn_mul' ) rm -f identifiers