Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 1 addition & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,41 +124,20 @@ if(CLICE_CI_ENVIRONMENT)
target_compile_definitions(clice_options INTERFACE CLICE_CI_ENVIRONMENT=1)
endif()

set(FBS_SCHEMA_FILE "${PROJECT_SOURCE_DIR}/src/index/schema.fbs")
set(GENERATED_HEADER "${PROJECT_BINARY_DIR}/generated/schema_generated.h")

if(CMAKE_CROSSCOMPILING)
find_program(FLATC_EXECUTABLE flatc REQUIRED)
set(FLATC_CMD "${FLATC_EXECUTABLE}")
else()
set(FLATC_CMD "$<TARGET_FILE:flatc>")
endif()

add_custom_command(
OUTPUT "${GENERATED_HEADER}"
COMMAND ${FLATC_CMD} --cpp -o "${PROJECT_BINARY_DIR}/generated" "${FBS_SCHEMA_FILE}"
DEPENDS "${FBS_SCHEMA_FILE}"
COMMENT "Generating C++ header from ${FBS_SCHEMA_FILE}"
)

add_custom_target(generate_flatbuffers_schema DEPENDS "${GENERATED_HEADER}")

file(GLOB_RECURSE CLICE_CORE_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/*.cpp")
add_library(clice-core STATIC ${CLICE_CORE_SOURCES})
add_library(clice::core ALIAS clice-core)
add_dependencies(clice-core generate_flatbuffers_schema)

target_include_directories(clice-core PUBLIC
"${PROJECT_SOURCE_DIR}/src"
"${PROJECT_BINARY_DIR}/generated"
)
target_link_libraries(clice-core PUBLIC
clice_options
llvm-libs
spdlog::spdlog
roaring::roaring
flatbuffers
kota::ipc::lsp
kota::codec::flatbuffers
kota::codec::toml
kota::option
simdjson::simdjson
Expand Down
17 changes: 4 additions & 13 deletions cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,20 @@ FetchContent_Declare(
set(ENABLE_ROARING_TESTS OFF CACHE INTERNAL "" FORCE)
set(ENABLE_ROARING_MICROBENCHMARKS OFF CACHE INTERNAL "" FORCE)

# flatbuffers
FetchContent_Declare(
flatbuffers
GIT_REPOSITORY https://github.com/google/flatbuffers.git
GIT_TAG v25.9.23
GIT_SHALLOW TRUE
)
set(FLATBUFFERS_BUILD_GRPC OFF CACHE BOOL "" FORCE)
set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "" FORCE)

FetchContent_Declare(
kotatsu
GIT_REPOSITORY https://github.com/clice-io/kotatsu
GIT_TAG 02b255f
GIT_TAG b4620e9
)

set(KOTA_ENABLE_ZEST ON)
set(KOTA_ENABLE_TEST OFF)
set(KOTA_CODEC_ENABLE_SIMDJSON ON)
set(KOTA_CODEC_ENABLE_YYJSON ON)
set(KOTA_CODEC_ENABLE_TOML ON)
# flatbuffers itself now comes transitively through kota::codec::flatbuffers.
set(KOTA_CODEC_ENABLE_FLATBUFFERS ON)
set(KOTA_ENABLE_EXCEPTIONS OFF)
set(KOTA_ENABLE_RTTI OFF)

FetchContent_MakeAvailable(kotatsu spdlog croaring flatbuffers)
FetchContent_MakeAvailable(kotatsu spdlog croaring)
82 changes: 0 additions & 82 deletions pixi.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ lld = "==20.1.8"
llvm-tools = "==20.1.8"
clang-tools = "==20.1.8"
compiler-rt = "==20.1.8"
flatbuffers = "==25.9.23"

[feature.build.target.win-64.dependencies]
sccache = "*"
Expand Down
7 changes: 5 additions & 2 deletions src/index/include_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "syntax/token.h"

#include "kota/meta/annotation.h"
#include "llvm/ADT/DenseMap.h"

namespace clice {
Expand Down Expand Up @@ -41,8 +42,10 @@ struct IncludeGraph {

/// Each `FileID` represents a new header context and is introduced
/// by a new include directive. So a include directive is a new header
/// context. A map between FileID and its include location.
llvm::DenseMap<clang::FileID, std::uint32_t> file_table;
/// context. A map between FileID and its include location. Build-time
/// only: FileIDs are meaningless outside the producing compilation, so
/// the field is skipped during serialization.
kota::meta::skip<llvm::DenseMap<clang::FileID, std::uint32_t>> file_table;

static IncludeGraph from(CompilationUnitRef unit);

Expand Down
Loading