Skip to content
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

[BACKPORT 2.28] tests: add a test for pkg-config files #9175

Closed
wants to merge 3 commits into from

Commits on Sep 11, 2024

  1. Add CMake package config file

    This change enables automatic detection and consumption of Mbed TLS
    library targets from within other CMake projects. By generating an
    `MbedTLSConfig.cmake` file, consuming projects receive a more complete
    view of these targets, allowing them to be used as dependencies which
    properly inherit the transitive dependencies of the libraries.
    
    This is fairly fragile, as it seems Mbed TLS's libraries do not appear
    to properly model their dependencies on other targets, including
    third-party dependencies. It is, however, sufficient for building and
    linking the compiled Mbed TLS libraries when there are no third-party
    dependencies involved. Further work is needed for more complex
    use-cases, but this will likely meet the needs of most projects.
    
    Resolves Mbed-TLS#298. Probably useful for Mbed-TLS#2857.
    
    This commit is modified in the backport over the original to consider:
      - 1f0cdaf Stop dispatching through obsolete functions
      - 3bc3409 Remove obsolete cd at the end of a component
    
    Signed-off-by: Chris Kay <chris.kay@arm.com>
    Signed-off-by: Bill Roberts <bill.roberts@arm.com>
    CJKay authored and billatarm committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    714c0e5 View commit details
    Browse the repository at this point in the history
  2. Remove generated files in all cmake_as_x tests

    Modified from original for backport without needing:
      - 687d1ab Makefile targets for automatically generated files
    
    Signed-off-by: David Horstmann <david.horstmann@arm.com>
    Signed-off-by: Bill Roberts <bill.roberts@arm.com>
    davidhorstmann-arm authored and billatarm committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    b52acc7 View commit details
    Browse the repository at this point in the history
  3. tests: add a test for pkg-config files

    Add a test that does some basic validation of the pkg-config files.
    
    Example Run:
    ./tests/scripts/all.sh test_cmake_as_package_install
    <snip>
    ******************************************************************
    * test_cmake_as_package_install: build: cmake 'as-installed-package' build
    * Wed Sep 11 15:34:54 UTC 2024
    ******************************************************************
    cmake .
    make
    Built against Mbed TLS 2.28.9
    testing package config file: mbedtls ... passed
    testing package config file: mbedx509 ... passed
    testing package config file: mbedcrypto ... passed
    make clean
    
    Signed-off-by: Bill Roberts <bill.roberts@arm.com>
    billatarm committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    7236a7a View commit details
    Browse the repository at this point in the history