Files
Language-Server/CMakeLists.txt
T
faumaray 62d6ad01e8 Serve document links for quoted includes
A bounded core resolves quoted include directives from the document
directory and reports the spelling range; the server advertises
documentLinkProvider and serves textDocument/documentLink from
snapshots, keeping only targets that exist on disk. Angle includes are
skipped because their search roots are unknown. Registered feature
tests cover resolution, indentation, line counting, skipping and
bounds, and the exact-capability-set assertion was updated. A real
stdio session linked extra.hpp and skipped <vector> and a missing
file.
2026-12-05 19:21:23 +03:00

59 lines
3.7 KiB
CMake

cmake_minimum_required(VERSION 4.0)
project(VoidLanguageServer VERSION 0.1.0 LANGUAGES CXX)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
message(FATAL_ERROR "VoidLanguageServer requires GCC 16+ with C++26 reflection; use dev cpp-gcc")
endif()
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-freflection")
check_cxx_source_compiles("#include <meta>\nstatic_assert(std::meta::is_type(^^int));\nint main() {}"
VLS_HAS_REFLECTION)
unset(CMAKE_REQUIRED_FLAGS)
if(NOT VLS_HAS_REFLECTION)
message(FATAL_ERROR "GCC must support <meta> and -freflection")
endif()
include(CTest)
set(VLS_VOID_SOURCE_DIR "" CACHE PATH "Explicit development-only VoidLibrary source override")
# User-selected development policy: follow main; record the tested commit in verification evidence.
set(VLS_VOID_REF "main")
include(cmake/VoidDependency.cmake)
vls_add_void_dependency()
add_library(vls_protocol STATIC src/Protocol/Framing.cpp src/Protocol/Json.cpp
src/Documents/DocumentSnapshot.cpp src/Documents/DocumentStore.cpp src/Documents/Position.cpp
src/Documents/Uri.cpp src/Workspace/Configuration.cpp src/Workspace/Trust.cpp src/Build/Model.cpp
src/Build/ProviderFile.cpp src/Build/CommandImport.cpp src/Build/VbsProvider.cpp
src/Build/CompdbProvider.cpp src/DocumentSync.cpp src/WorkspaceSession.cpp src/Server.cpp
src/semantic/Diagnostics.cpp src/semantic/SourceCatalog.cpp src/semantic/StockCompiler.cpp src/semantic/EditorDiagnostics.cpp src/semantic/Occurrences.cpp src/scheduler/Scheduler.cpp
src/modules/ModuleGraph.cpp src/modules/ArtifactCache.cpp src/modules/GccArtifacts.cpp src/modules/ScheduledArtifacts.cpp src/index/SymbolIndex.cpp src/navigation/Navigation.cpp src/reflection/Provenance.cpp src/features/Completion.cpp src/features/IndexNavigation.cpp src/features/SignatureHelp.cpp src/features/DocumentSymbols.cpp src/features/TextStructure.cpp src/features/CodeActions.cpp src/features/SemanticTokens.cpp src/features/InlayHints.cpp src/features/FileOperations.cpp src/features/IncludeUpdate.cpp src/features/CallHierarchy.cpp src/features/CodeLens.cpp src/features/DocumentLinks.cpp src/debug/live/LiveSession.cpp src/modules/ModuleWorkQueue.cpp src/modules/GccScan.cpp src/modules/ScanCommand.cpp)
target_include_directories(vls_protocol PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_link_libraries(vls_protocol PUBLIC Void::Data PRIVATE Void::Unicode Void::Text Void::Crypto Void::System)
target_compile_options(vls_protocol PUBLIC -freflection PRIVATE -Wall -Wextra -Wpedantic)
add_executable(vls src/main.cpp)
target_link_libraries(vls PRIVATE vls_protocol Void::Configuration)
target_compile_options(vls PRIVATE -Wall -Wextra -Wpedantic)
include(GNUInstallDirs)
install(TARGETS vls RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
add_library(vls_gcc_trace STATIC experiments/frontend/gcc-worker/Trace.cpp
src/debug/inspection/ReplaySession.cpp)
target_include_directories(vls_gcc_trace PUBLIC experiments/frontend/gcc-worker)
target_link_libraries(vls_gcc_trace PRIVATE vls_protocol Void::Crypto Void::Unicode)
add_executable(vls-dap src/debug/dap/Main.cpp src/debug/dap/Projection.cpp)
target_link_libraries(vls-dap PRIVATE vls_gcc_trace vls_protocol)
target_compile_options(vls-dap PRIVATE -Wall -Wextra -Wpedantic)
install(TARGETS vls-dap RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
add_executable(vls_gcc_probe experiments/frontend/gcc-worker/Main.cpp
experiments/frontend/gcc-worker/Leaf.cpp experiments/frontend/gcc-worker/Supervisor.cpp)
target_link_libraries(vls_gcc_probe PRIVATE vls_gcc_trace vls_protocol Void::Crypto Void::System)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()