Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Build improvements #4841

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cmake/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,24 @@ endif()

add_library(LLVMHeaders INTERFACE IMPORTED)
target_include_directories(LLVMHeaders INTERFACE ${LLVM_INCLUDE_DIRS})

function(find_llvm_libs REQUIRED_LLVM_LIBS)
find_library(LLVM_SHARED_LIB LLVM NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH PATHS ${LLVM_LIBRARY_DIR})
set(LLVM_LIBS_TMP "" PARENT_SCOPE)
foreach(LIB IN LISTS REQUIRED_LLVM_LIBS)
find_library(LLVM_LIB ${LIB} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH PATHS ${LLVM_LIBRARY_DIR})
if(LLVM_LIB OR TARGET ${LIB})
message(VERBOSE "Adding ${LIB}")
list(APPEND LLVM_LIBS_TMP ${LIB})
elseif(LLVM_SHARED_LIB)
set(LLVM_LIBS ${LLVM_SHARED_LIB} PARENT_SCOPE)
message(STATUS "Using shared LLVM library.")
return()
else()
message(FATAL_ERROR "Can't find necessary LLVM libraries")
endif()
endforeach()

set(LLVM_LIBS ${LLVM_LIBS_TMP} PARENT_SCOPE)
message(STATUS "Using static LLVM libraries.")
endfunction()
6 changes: 5 additions & 1 deletion cmake/Findabsl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ if(absl_FOUND)
return()
endif()

message("Abseil not found via find_package. Probably not a Conan build. Using the copy from third_party/")
message(WARNING "To ensure Abseil is built with C++17 support,
it will be built from third_party folder.
If your system already has Abseil installed with C++17 support,
you can specify the Abseil configuration directory
by setting the absl_DIR variable as a cmake argument.")

set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(${CMAKE_SOURCE_DIR}/third_party/abseil-cpp)
Expand Down
1 change: 1 addition & 0 deletions cmake/Findlibprocinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ if(NOT MSVC)
target_compile_options(libprocinfo PRIVATE
-Wno-error=format=
-Wno-error=unknown-pragmas
-Wno-error=ignored-attributes
)
endif()
15 changes: 10 additions & 5 deletions src/ObjectUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

cmake_minimum_required(VERSION 3.15)

set(REQUIRED_LLVM_LIBS LLVMDebugInfoCodeView
LLVMDebugInfoDWARF
LLVMDebugInfoPDB
LLVMObject
LLVMSymbolize)

find_llvm_libs("${REQUIRED_LLVM_LIBS}")

project(ObjectUtils)
add_library(ObjectUtils STATIC)

Expand Down Expand Up @@ -55,12 +63,9 @@ target_link_libraries(
absl::synchronization
absl::time
absl::span
LLVMDebugInfoCodeView
LLVMDebugInfoDWARF
LLVMDebugInfoPDB
LLVMHeaders
LLVMObject
LLVMSymbolize)
${LLVM_LIBS}
)

if (WIN32)
target_link_libraries(ObjectUtils PUBLIC DIASDK::DIASDK)
Expand Down
1 change: 1 addition & 0 deletions third_party/Outcome/include/outcome.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <boost/outcome/std_result.hpp> // IWYU pragma: export
#include <boost/outcome/success_failure.hpp> // IWYU pragma: export
#include <boost/outcome/try.hpp> // IWYU pragma: export
#include <boost/version.hpp> // IWYU pragma: export
#include <system_error>
#include <utility>

Expand Down