-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSSM-2029 Enable bssl-compat cmake build in upstream build container
A number of small changes to enable a cmake build of bssl-compat to work in the upstream envoyproxy/envoy-build-ubuntu builder image: - The uncomment.sh script now explicitly uses gawk rather than awk so it knows which awk dialect it can use without any surprises. - If OpenSSL is built as an ExternalProject, because it cannot be found installed on the host, then we need to tell the bssl-compat-utests binary where to load libcrypto/ssl.so from by adding their path to the executable's RPATH. - Since the LLVM libraries can be configured & built with or without RTTI and/or exceptions, the compile & link of the prefixer tool needs to accommodte such differences. To achieve this, it now uses the LLVM provided cmake function llvm_update_compile_flags() to add the appropriate rtti and/or exception compilation flags. - The prefixer now makes use of the LLVM_LIBRARY_DIR cmake variable, to locate the system headers (previously fixed to just /usr/lib/clang/...). Signed-off-by: Ted Poole <tpoole@redhat.com>
- Loading branch information
Showing
5 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
project(prefixer) | ||
|
||
find_package(LLVM REQUIRED CONFIG) | ||
# https://llvm.org/docs/CMake.html#embedding-llvm-in-your-project | ||
|
||
find_package(Clang REQUIRED CONFIG) | ||
find_package(LLVM REQUIRED CONFIG) | ||
|
||
add_executable(prefixer prefixer.cpp) | ||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} (${LLVM_INSTALL_PREFIX},${LLVM_ENABLE_EH},${LLVM_ENABLE_RTTI},${LLVM_LINK_LLVM_DYLIB})") | ||
|
||
list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR}) | ||
include(AddLLVM) # For llvm_update_compile_flags() | ||
|
||
add_executable(prefixer prefixer.cpp) | ||
llvm_update_compile_flags(prefixer) # Adds appropriate exception & rtti flags | ||
target_compile_definitions(prefixer PRIVATE LLVM_LIBRARY_DIR=\"${LLVM_LIBRARY_DIR}\") | ||
target_include_directories(prefixer PRIVATE "${LLVM_INCLUDE_DIRS}") | ||
target_link_directories(prefixer PRIVATE "${LLVM_LIBRARY_DIRS}") | ||
target_link_libraries(prefixer PRIVATE clang-cpp LLVM) | ||
target_link_libraries(prefixer PRIVATE clang-cpp $<$<BOOL:${LLVM_LINK_LLVM_DYLIB}>:LLVM>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters