Skip to content
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
2 changes: 1 addition & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-Dvt_tests_num_nodes="${VT_TESTS_NUM_NODES:-}" \
-Dvt_external_fmt="${VT_EXTERNAL_FMT:-0}" \
-Dfmt_DIR="${FMT_DIR}" \
-DLIBUNWIND_ROOT="${LIBUNWIND_ROOT:-/usr}" \
-Dlibunwind_ROOT="${LIBUNWIND_ROOT:-/usr}" \
-Dvt_no_color_enabled="${VT_NO_COLOR_ENABLED:-0}" \
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-17}" \
-DBUILD_SHARED_LIBS="${BUILD_SHARED_LIBS:-0}" \
Expand Down
34 changes: 17 additions & 17 deletions cmake-modules/Findlibunwind.cmake
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@

# Users can pass LIBUNWIND_ROOT, LIBUNWIND_INCLUDE_DIR, and LIBUNWIND_LIBRARY as CMake variables.
# If LIBUNWIND_ROOT is provided, the INCLUDE_DIR and LIBRARY variables may be omitted.
# Users can pass libunwind_ROOT, libunwind_INCLUDE_DIR, and libunwind_LIBRARY as CMake variables.
# If libunwind_ROOT is provided, the INCLUDE_DIR and LIBRARY variables may be omitted.
#
# LIBUNWIND_FOUND, LIBUNWIND_INCLUDE_DIRS, and LIBUNWIND_LIBRARIES are outputs
# libunwind_FOUND, libunwind_INCLUDE_DIRS, and libunwind_LIBRARIES are outputs

if(LIBUNWIND_ROOT)
set(LIBUNWIND_INCLUDE_DIR ${LIBUNWIND_INCLUDE_DIR};${LIBUNWIND_ROOT}/include)
set(LIBUNWIND_LIBRARY ${LIBUNWIND_LIBRARY};${LIBUNWIND_ROOT}/lib64;${LIBUNWIND_ROOT}/lib)
if(libunwind_ROOT)
set(libunwind_INCLUDE_DIR ${libunwind_INCLUDE_DIR};${libunwind_ROOT}/include)
set(libunwind_LIBRARY ${libunwind_LIBRARY};${libunwind_ROOT}/lib64;${libunwind_ROOT}/lib)
endif()

# First, check only in the hinted paths
find_path(LIBUNWIND_INCLUDE_DIRS NAMES libunwind.h
find_path(libunwind_INCLUDE_DIRS NAMES libunwind.h
DOC "The libunwind include directory"
HINTS ${LIBUNWIND_INCLUDE_DIR}
HINTS ${libunwind_INCLUDE_DIR}
NO_DEFAULT_PATH
)
find_library(LIBUNWIND_LIBRARIES NAMES unwind
find_library(libunwind_LIBRARIES NAMES unwind
DOC "The libunwind library"
HINTS ${LIBUNWIND_LIBRARY}
HINTS ${libunwind_LIBRARY}
NO_DEFAULT_PATH
)

# If that fails, check in CMake's default paths
find_path(LIBUNWIND_INCLUDE_DIRS NAMES libunwind.h
find_path(libunwind_INCLUDE_DIRS NAMES libunwind.h
DOC "The libunwind include directory"
)
find_library(LIBUNWIND_LIBRARIES NAMES unwind
find_library(libunwind_LIBRARIES NAMES unwind
DOC "The libunwind library"
)

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUNWIND
REQUIRED_VARS LIBUNWIND_LIBRARIES LIBUNWIND_INCLUDE_DIRS)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libunwind
REQUIRED_VARS libunwind_LIBRARIES libunwind_INCLUDE_DIRS)

if(LIBUNWIND_FOUND)
if(libunwind_FOUND)
if(NOT TARGET libunwind)
add_library(libunwind UNKNOWN IMPORTED)
set_target_properties(libunwind PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBUNWIND_INCLUDE_DIRS}")
set_property(TARGET libunwind APPEND PROPERTY IMPORTED_LOCATION "${LIBUNWIND_LIBRARY}")
set_target_properties(libunwind PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${libunwind_INCLUDE_DIRS}")
set_property(TARGET libunwind APPEND PROPERTY IMPORTED_LOCATION "${libunwind_LIBRARY}")
endif()
endif()
2 changes: 1 addition & 1 deletion cmake/link_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function(link_target_with_vt)
endif()
if (NOT DEFINED APPLE)
target_link_libraries(
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${LIBUNWIND_LIBRARIES}
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${libunwind_LIBRARIES}
)
endif()
endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake/load_libunwind.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
set(vt_feature_cmake_libunwind "0")

if(NOT DEFINED LIBUNWIND_ROOT)
set(LIBUNWIND_ROOT "/usr")
if(NOT DEFINED libunwind_ROOT)
set(libunwind_ROOT "/usr")
endif()

find_package(libunwind)

if(LIBUNWIND_FOUND)
if(libunwind_FOUND)
set(vt_feature_cmake_libunwind "1")
endif()
Loading