From 655ddababa5ca68eb00fb0229b7ce580182d1af2 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Mon, 21 Jan 2019 17:26:19 +0000 Subject: [PATCH] 3rdparty: Add additional build facilities for 3rd-party code --- CMakeLists.txt | 6 +++++- include/CMakeLists.txt | 3 +-- library/CMakeLists.txt | 3 ++- programs/Makefile | 3 ++- tests/Makefile | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9d2d8147..57b4b3acd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,7 +181,7 @@ else() set(LIB_INSTALL_DIR lib) endif() -include_directories(include/ 3rdparty/everest/include/ 3rdparty/everest/include/everest/ 3rdparty/everest/include/everest/kremlin/ 3rdparty/everest/include/everest/kremlib/) +include_directories(include/) if(ENABLE_ZLIB_SUPPORT) find_package(ZLIB) @@ -192,6 +192,10 @@ if(ENABLE_ZLIB_SUPPORT) endif(ENABLE_ZLIB_SUPPORT) add_subdirectory(3rdparty) +include_directories(${thirdparty_inc}) +list(APPEND libs ${thirdparty_lib}) +add_definitions(${thirdparty_def}) + add_subdirectory(library) add_subdirectory(include) add_subdirectory(crypto/library) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index ef33fe828..c2f2bd4e6 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -3,9 +3,8 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) if(INSTALL_MBEDTLS_HEADERS) file(GLOB headers "mbedtls/*.h") - file(GLOB headers_everest "../3rdparty/everest/include/*.h") - install(FILES ${headers} ${headers_everest} + install(FILES ${headers} DESTINATION include/mbedtls PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index afabdf7d5..2afbfd730 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -64,9 +64,10 @@ set(src_crypto version.c version_features.c xtea.c - ${src_thirdparty} ) +list(APPEND src_crypto ${thirdparty_src}) + set(src_x509 certs.c pkcs11.c diff --git a/programs/Makefile b/programs/Makefile index f09487712..0e4f7d628 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -18,7 +18,8 @@ LOCAL_LDFLAGS += -L../crypto/library LOCAL_CFLAGS += -I../crypto/include LOCAL_CXXFLAGS += -I../crypto/include -LOCAL_CFLAGS+=-I../3rdparty/everest/include +include ../3rdparty/Makefile.inc +LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES) ifndef SHARED DEP=../crypto/library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a diff --git a/tests/Makefile b/tests/Makefile index d1c265e52..3857778e7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -16,7 +16,8 @@ LOCAL_LDFLAGS += -L../crypto/library LOCAL_CFLAGS += -I../crypto/include CRYPTO := ../crypto/library/ -LOCAL_CFLAGS+=-I../3rdparty/everest/include +include ../3rdparty/Makefile.inc +LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES) # Enable definition of various functions used throughout the testsuite # (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless