Update loguru

This commit is contained in:
Fangrui Song 2018-04-15 10:21:26 -07:00
parent 79df82d4a1
commit 12ad568159
4 changed files with 21 additions and 19 deletions

View File

@ -4,12 +4,12 @@ project(ccls LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
include(DefaultCMakeBuildType) include(DefaultCMakeBuildType)
# Required libclang version # Required Clang version
set(LIBCLANG_VERSION 6.0.0 CACHE STRING "libclang version") set(CLANG_VERSION 6.0.0 CACHE STRING "Clang version")
set(LIBCLANG_DOWNLOAD_LOCATION ${CMAKE_BINARY_DIR} set(CLANG_DOWNLOAD_LOCATION ${CMAKE_BINARY_DIR}
CACHE STRING "Downloaded libclang location") CACHE STRING "Downloaded Clang location")
option(SYSTEM_LIBCLANG "Use system installation of libclang instead of \ option(SYSTEM_CLANG "Use system installation of Clang instead of \
downloading libclang" OFF) downloading Clang" OFF)
option(ASAN "Compile with address sanitizers" OFF) option(ASAN "Compile with address sanitizers" OFF)
# Sources for the executable are specified at end of CMakeLists.txt # Sources for the executable are specified at end of CMakeLists.txt
@ -72,23 +72,23 @@ else()
endif() endif()
endif() endif()
### Download libclang if required ### Download Clang if required
if(NOT SYSTEM_CLANG)
message(STATUS "Using downloaded Clang")
if(NOT SYSTEM_LIBCLANG)
message(STATUS "Using downloaded libclang")
include(DownloadAndExtractClang) include(DownloadAndExtractClang)
download_and_extract_clang(${LIBCLANG_VERSION} ${LIBCLANG_DOWNLOAD_LOCATION}) download_and_extract_clang(${CLANG_VERSION} ${CLANG_DOWNLOAD_LOCATION})
# Used by FindClang # Used by FindClang
set(CLANG_ROOT ${DOWNLOADED_CLANG_DIR}) set(CLANG_ROOT ${DOWNLOADED_CLANG_DIR})
else() else()
message(STATUS "Using system libclang") message(STATUS "Using system Clang")
endif() endif()
### Libraries ### Libraries
# See cmake/FindClang.cmake # See cmake/FindClang.cmake
find_package(Clang ${LIBCLANG_VERSION} REQUIRED) find_package(Clang ${CLANG_VERSION} REQUIRED)
target_link_libraries(ccls PRIVATE Clang::Clang) target_link_libraries(ccls PRIVATE Clang::Clang)
# Enable threading support # Enable threading support
@ -142,7 +142,7 @@ target_include_directories(ccls PRIVATE
install(TARGETS ccls RUNTIME DESTINATION bin) install(TARGETS ccls RUNTIME DESTINATION bin)
# TODO: install libclang.dll on Windows as well # TODO: install libclang.dll on Windows as well
if(NOT SYSTEM_LIBCLANG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL Windows) if(NOT SYSTEM_CLANG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL Windows)
if(${CMAKE_SYSTEM_NAME} MATCHES Linux|FreeBSD) if(${CMAKE_SYSTEM_NAME} MATCHES Linux|FreeBSD)
set_property(TARGET ccls APPEND PROPERTY set_property(TARGET ccls APPEND PROPERTY
@ -158,7 +158,7 @@ if(NOT SYSTEM_LIBCLANG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL Windows)
endif() endif()
# Allow running from build Windows by copying libclang.dll to build directory # Allow running from build Windows by copying libclang.dll to build directory
if(NOT SYSTEM_LIBCLANG AND ${CMAKE_SYSTEM_NAME} STREQUAL Windows) if(NOT SYSTEM_CLANG AND ${CMAKE_SYSTEM_NAME} STREQUAL Windows)
add_custom_command(TARGET ccls add_custom_command(TARGET ccls
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy COMMAND ${CMAKE_COMMAND} -E copy

View File

@ -664,9 +664,8 @@ void SetVarDetail(IndexVar* var,
} }
if (is_first_seen) { if (is_first_seen) {
std::optional<IndexTypeId> var_type = if (std::optional<IndexTypeId> var_type =
ResolveToDeclarationType(db, cursor, param); ResolveToDeclarationType(db, cursor, param)) {
if (var_type) {
// Don't treat enum definition variables as instantiations. // Don't treat enum definition variables as instantiations.
bool is_enum_member = semanticContainer && bool is_enum_member = semanticContainer &&
semanticContainer->cursor.kind == CXCursor_EnumDecl; semanticContainer->cursor.kind == CXCursor_EnumDecl;

View File

@ -341,6 +341,9 @@ int main(int argc, char** argv) {
if (!HasOption(options, "--log-all-to-stderr")) if (!HasOption(options, "--log-all-to-stderr"))
loguru::g_stderr_verbosity = loguru::Verbosity_WARNING; loguru::g_stderr_verbosity = loguru::Verbosity_WARNING;
loguru::g_preamble_date = false;
loguru::g_preamble_time = false;
loguru::g_preamble_verbose = false;
loguru::g_flush_interval_ms = 0; loguru::g_flush_interval_ms = 0;
loguru::init(argc, argv); loguru::init(argc, argv);

2
third_party/loguru vendored

@ -1 +1 @@
Subproject commit 2c35b5e7251ab5d364b1b3164eccef7b5d2293c5 Subproject commit 6bf94c5f2bec437e871402d0a27e8a3094b261d5