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

Use CMake commands to set S2N_LIBCRYPTO environment variable #4814

Open
boquan-fang opened this issue Oct 1, 2024 · 0 comments
Open

Use CMake commands to set S2N_LIBCRYPTO environment variable #4814

boquan-fang opened this issue Oct 1, 2024 · 0 comments

Comments

@boquan-fang
Copy link
Contributor

Problem:

The current way of setting S2N_LIBCRYPTO environment variable is through passing it in CMAKE_PREFIX_PATH, and then use it in CMakeLists.txt. We want to set S2N_LIBCRYPTO in a more deliberate CMake design.

cmake . -Bbuild \
-DCMAKE_C_COMPILER=/usr/bin/$COMPILER \
-DCMAKE_PREFIX_PATH=/usr/local/$S2N_LIBCRYPTO \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DASAN=ON \
-DUBSAN=ON

s2n-tls/CMakeLists.txt

Lines 235 to 238 in a29068a

if (NOT $ENV{S2N_LIBCRYPTO} MATCHES "awslc")
# add cast-qual back in for non AWS-LC
target_compile_options(${PROJECT_NAME} PRIVATE -Wcast-qual)
endif()

Solution:

  • Pass libcrypto into CMake, and use set to set environment variable.

Requirements / Acceptance Criteria:

  • Buildspec files shouldn't directly pass in libcrypto through CMAKE_PREFIX_PATH.
  • CMakeLists.txt should directly set S2N_LIBCRYPTO via CMake commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants