Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
Open
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
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ target_link_libraries(cquery PRIVATE Threads::Threads)
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
# loguru calls dladdr
target_link_libraries(cquery PRIVATE ${CMAKE_DL_LIBS})
string(FIND ${CMAKE_HOST_SYSTEM_PROCESSOR} "armv7" result)

if(${result} GREATER -1)
target_link_libraries(cquery PRIVATE atomic)
endif()

elseif(${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
# loguru::stacktrace_as_stdstring calls backtrace_symbols
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bd962b32818f8b07ae60e708f736eca5cd856f0d34ed9d1038cc9e0991390217
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2d831636d54ff7a3225a3a52f05b8723110e71fa982de1fa55c9fed307ec8aca
28 changes: 19 additions & 9 deletions cmake/DownloadAndExtractClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
set(CLANG_ARCHIVE_NAME
clang+llvm-${CLANG_VERSION}-x86_64-linux-gnu-ubuntu-16.04)
endif()
message(STATUS "Host system processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(CLANG_ARCHIVE_NAME clang+llvm-${CLANG_VERSION}-aarch64-linux-gnu)
elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "armv7l")
set(CLANG_ARCHIVE_NAME clang+llvm-${CLANG_VERSION}-armv7a-linux-gnueabihf)
endif()
endif()

elseif(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
Expand Down Expand Up @@ -73,15 +79,19 @@ file an issue to get it added.")
endif()

# Download Clang archive
message(STATUS "Downloading Clang ${CLANG_VERSION} (${CLANG_ARCHIVE_URL}) ...")
file(DOWNLOAD ${CLANG_ARCHIVE_URL} ${CLANG_ARCHIVE_FILE}
STATUS CLANG_ARCHIVE_DOWNLOAD_RESULT)

# Abort if download failed
list(GET ${CLANG_ARCHIVE_DOWNLOAD_RESULT} 0 ERROR_CODE)
if(${ERROR_CODE})
list(GET ${CLANG_ARCHIVE_DOWNLOAD_RESULT} 1 ERROR_STRING)
message(FATAL_ERROR ${ERROR_STRING})
if (EXISTS ${CLANG_ARCHIVE_FILE})
message (STATUS "file exists, skipping download: ${CLANG_ARCHIVE_FILE}")
else()
message(STATUS "Downloading Clang ${CLANG_VERSION} (${CLANG_ARCHIVE_URL}) ...")
file(DOWNLOAD ${CLANG_ARCHIVE_URL} ${CLANG_ARCHIVE_FILE}
STATUS CLANG_ARCHIVE_DOWNLOAD_RESULT)

# Abort if download failed
list(GET ${CLANG_ARCHIVE_DOWNLOAD_RESULT} 0 ERROR_CODE)
if(${ERROR_CODE})
list(GET ${CLANG_ARCHIVE_DOWNLOAD_RESULT} 1 ERROR_STRING)
message(FATAL_ERROR ${ERROR_STRING})
endif()
endif()

# Retrieve expected hash from file and strip newline
Expand Down
9 changes: 9 additions & 0 deletions cquery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# with clang90
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=debug -DCLANG_ROOT=$HOME/toolchains/clang90 -DSYSTEM_CLANG=ON
# export LD_LIBRARY_PATH=$HOME/toolchains/clang90/lib:$LD_LIBRARY_PATH
# $HOME/SRC_jetson/cquery-kuba/build_clang90/debug/bin/cquery $@

$HOME/SRC_jetson/cquery-kuba/build/cquery $@