From 190be0667cf1f7b39bed2c96760f08a6295b652b Mon Sep 17 00:00:00 2001 From: Justin W Smith <103147162+justsmth@users.noreply.github.com> Date: Wed, 22 Jan 2025 07:55:20 -0500 Subject: [PATCH] Only need libunwind for testing (#2131) ### Notice This change does not modify the FIPS module boundary. This change only avoids having CMake check for the availability of `Libunwind` when no tests are being built. ### Description of changes: * Libunwind is only needed when building tests. * See same change made for main: https://github.com/aws/aws-lc/pull/2093 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a35fd05c2f..1090cd53e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,7 @@ if(NOT DISABLE_PERL) find_package(Perl REQUIRED) endif() -if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT CMAKE_CROSSCOMPILING) +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) find_package(PkgConfig QUIET) if (PkgConfig_FOUND) pkg_check_modules(LIBUNWIND libunwind-generic)