mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 11:34:15 +01:00
Remove use of CMAKE_SOURCE_DIR
Remove use of CMAKE_SOURCE_DIR in case mbedtls is built from within another CMake project. Define MBEDTLS_DIR to ${CMAKE_CURRENT_SOURCE_DIR} in the main CMakeLists.txt file and refer to that when defining target include paths to enable mbedtls to be built as a sub project. Fixes #2609 Signed-off-by: Ashley Duncan <ashes.man@gmail.com> Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
This commit is contained in:
parent
85da85555e
commit
eb33978fa8
@ -5,6 +5,8 @@ else()
|
|||||||
project("mbed TLS" C)
|
project("mbed TLS" C)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
|
option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
|
||||||
option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)
|
option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)
|
||||||
|
|
||||||
|
@ -151,15 +151,15 @@ if(USE_STATIC_MBEDTLS_LIBRARY)
|
|||||||
set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509)
|
set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509)
|
||||||
target_link_libraries(${mbedx509_static_target} ${libs} ${mbedcrypto_static_target})
|
target_link_libraries(${mbedx509_static_target} ${libs} ${mbedcrypto_static_target})
|
||||||
target_include_directories(${mbedx509_static_target}
|
target_include_directories(${mbedx509_static_target}
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/include/
|
PUBLIC ${MBEDTLS_DIR}/include/
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/crypto/include/)
|
PUBLIC ${MBEDTLS_DIR}/crypto/include/)
|
||||||
|
|
||||||
add_library(${mbedtls_static_target} STATIC ${src_tls})
|
add_library(${mbedtls_static_target} STATIC ${src_tls})
|
||||||
set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
|
set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
|
||||||
target_link_libraries(${mbedtls_static_target} ${libs} ${mbedx509_static_target})
|
target_link_libraries(${mbedtls_static_target} ${libs} ${mbedx509_static_target})
|
||||||
target_include_directories(${mbedtls_static_target}
|
target_include_directories(${mbedtls_static_target}
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/include/
|
PUBLIC ${MBEDTLS_DIR}/include/
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/crypto/include/
|
PUBLIC ${MBEDTLS_DIR}/crypto/include/
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -175,15 +175,15 @@ if(USE_SHARED_MBEDTLS_LIBRARY)
|
|||||||
set_target_properties(mbedx509 PROPERTIES VERSION 2.18.0 SOVERSION 1)
|
set_target_properties(mbedx509 PROPERTIES VERSION 2.18.0 SOVERSION 1)
|
||||||
target_link_libraries(mbedx509 ${libs} mbedcrypto)
|
target_link_libraries(mbedx509 ${libs} mbedcrypto)
|
||||||
target_include_directories(mbedx509
|
target_include_directories(mbedx509
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/include/
|
PUBLIC ${MBEDTLS_DIR}/include/
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/crypto/include/)
|
PUBLIC ${MBEDTLS_DIR}/crypto/include/)
|
||||||
|
|
||||||
add_library(mbedtls SHARED ${src_tls})
|
add_library(mbedtls SHARED ${src_tls})
|
||||||
set_target_properties(mbedtls PROPERTIES VERSION 2.18.0 SOVERSION 13)
|
set_target_properties(mbedtls PROPERTIES VERSION 2.18.0 SOVERSION 13)
|
||||||
target_link_libraries(mbedtls ${libs} mbedx509)
|
target_link_libraries(mbedtls ${libs} mbedx509)
|
||||||
target_include_directories(mbedtls
|
target_include_directories(mbedtls
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/include/
|
PUBLIC ${MBEDTLS_DIR}/include/
|
||||||
PUBLIC ${CMAKE_SOURCE_DIR}/crypto/include/)
|
PUBLIC ${MBEDTLS_DIR}/crypto/include/)
|
||||||
|
|
||||||
install(TARGETS mbedtls mbedx509
|
install(TARGETS mbedtls mbedx509
|
||||||
DESTINATION ${LIB_INSTALL_DIR}
|
DESTINATION ${LIB_INSTALL_DIR}
|
||||||
|
Loading…
Reference in New Issue
Block a user