Skip to content

Fix CMake install dir defaults on macOS/Windows when CMAKE_INSTALL_LIBDIR is specified#3069

Open
justsmth wants to merge 1 commit intoaws:mainfrom
justsmth:fix-cmake-install
Open

Fix CMake install dir defaults on macOS/Windows when CMAKE_INSTALL_LIBDIR is specified#3069
justsmth wants to merge 1 commit intoaws:mainfrom
justsmth:fix-cmake-install

Conversation

@justsmth
Copy link
Copy Markdown
Contributor

@justsmth justsmth commented Mar 4, 2026

Description of changes:

On macOS and Windows, the fallback defaults for CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_BINDIR were gated behind a single elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) check. If CMAKE_INSTALL_LIBDIR was passed on the command line (e.g. -DCMAKE_INSTALL_LIBDIR=lib), the condition was false and the other two variables never got set — causing install(DIRECTORY ... DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) to fail with "install DIRECTORY given no DESTINATION!".

This changes the elseif to an else block that sets each variable independently when not already defined.

Call-outs:

Only affects the macOS/Windows code path (the NOT WIN32 AND NOT APPLE branch already uses GNUInstallDirs which handles everything). The gRPC integration script (run_grpc_integration.sh) hits this because aws_lc_build always passes -DCMAKE_INSTALL_LIBDIR=lib.

Testing:

Verified the CMake configure step succeeds on macOS with -DCMAKE_INSTALL_LIBDIR=lib. The gRPC integration build (run_grpc_integration.sh) no longer errors during the AWS-LC configure phase.

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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.12%. Comparing base (a75e930) to head (2ddce7d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3069      +/-   ##
==========================================
+ Coverage   77.95%   78.12%   +0.16%     
==========================================
  Files         689      689              
  Lines      122506   122506              
  Branches    17095    17100       +5     
==========================================
+ Hits        95505    95706     +201     
+ Misses      26102    25901     -201     
  Partials      899      899              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgmenda sgmenda self-assigned this Mar 6, 2026
sgmenda
sgmenda previously approved these changes Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants