-
Notifications
You must be signed in to change notification settings - Fork 2.7k
CMake: fix build with 3rdparty module enabled through a custom config #8284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,19 @@ target_include_directories(p256m | |
$<INSTALL_INTERFACE:include> | ||
PRIVATE ${MBEDTLS_DIR}/library/) | ||
|
||
# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since P256-M is a PSA driver, does it need the PSA config file(s)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may do, but we currently do not support passing This would be a useful thing to have, but I think it is out of scope for this PR as it would involve adding new functionality across the whole repo rather than just the 3rdparty modules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PSA config files only define |
||
# This must be duplicated from library/CMakeLists.txt because | ||
# p256m is not directly linked against any mbedtls targets | ||
# so does not inherit the compile definitions. | ||
if(MBEDTLS_CONFIG_FILE) | ||
target_compile_definitions(p256m | ||
PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}") | ||
endif() | ||
if(MBEDTLS_USER_CONFIG_FILE) | ||
target_compile_definitions(p256m | ||
PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}") | ||
endif() | ||
|
||
if(INSTALL_MBEDTLS_HEADERS) | ||
|
||
install(DIRECTORY :${CMAKE_CURRENT_SOURCE_DIR} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems wrong and error-prone that we're doing this in each 3rdparty subdirectory. We'll need to copy-paste this whenever we add a new 3rdparty library, and it's likely we'll forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a better solution which was implemented in the new PSA repo, but it would be a much more major change than this. I would suggest doing it this way for now, and making a ticket to port Ronald's PSA solution back to MbedTLS asap.