-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEPENDENCIES] Bump Slang to v7.0 and fix hash def
In order to align the indexer with v7.0, it was required to remove a definition of a hash on slang::SourceRange that has been introduced in v7.0 This commit also integrate personnal work in order to perform a better split of the project in sub-libs. Fix #14
- Loading branch information
Showing
9 changed files
with
223 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
function(create_component NAME) | ||
set(options NOLIB) | ||
set(multiValueArgs | ||
LIB_SRC | ||
LIB_INC | ||
LIB_LINK | ||
EXE_SRC | ||
EXE_INC | ||
EXE_LINK | ||
) | ||
cmake_parse_arguments(PARSE_ARGV 1 COMP "${options}" "${oneValueArgs}" "${multiValueArgs}") | ||
|
||
if(NOT ${COMP_NOLIB}) | ||
add_library(${NAME}-lib STATIC) | ||
if(DEFINED COMP_LIB_SRC) | ||
target_sources(${NAME}-lib ${COMP_LIB_SRC}) | ||
endif() | ||
|
||
if(DEFINED COMP_LIB_LINK) | ||
target_link_libraries(${NAME}-lib ${COMP_LIB_LINK}) | ||
endif() | ||
|
||
if(DEFINED COMP_LIB_INC) | ||
target_include_directories(${NAME}-lib ${COMP_LIB_INC}) | ||
endif() | ||
|
||
if(NOT DEFINED COMP_EXE_LINK) | ||
set(COMP_EXE_LINK "") | ||
endif() | ||
|
||
if(NOT DEFINED COMP_EXE_INC) | ||
set(COMP_EXE_LINK "") | ||
endif() | ||
|
||
list(PREPEND COMP_EXE_LINK PRIVATE ${NAME}-lib) | ||
list(PREPEND COMP_EXE_INC PRIVATE $<TARGET_PROPERTY:${NAME}-lib,INTERFACE_INCLUDE_DIRECTORIES>) | ||
# message(STATUS " EXE INC : ${COMP_EXE_INC}") | ||
# Override the output name to avoid libNAME-lib.so | ||
# The lib prefix is automatically added. | ||
set_property(TARGET ${NAME}-lib PROPERTY OUTPUT_NAME ${NAME}) | ||
else() | ||
message(STATUS "No library for target component ${NAME}") | ||
endif() | ||
|
||
add_executable(${NAME}-exe) | ||
if(DEFINED COMP_EXE_SRC) | ||
target_sources(${NAME}-exe ${COMP_EXE_SRC}) | ||
else() | ||
message(ERROR "Component ${NAME} have no source specified for its executable (EXE_SRC)") | ||
endif() | ||
|
||
|
||
target_link_libraries(${NAME}-exe ${COMP_EXE_LINK}) | ||
target_include_directories(${NAME}-exe ${COMP_EXE_INC}) | ||
|
||
# Override the output name of the executable to have a clean NAME | ||
# instead of NAME-exe. | ||
set_property(TARGET ${NAME}-exe PROPERTY OUTPUT_NAME ${NAME}) | ||
|
||
message(STATUS "Created targets for component ${NAME}.") | ||
|
||
endfunction(create_component) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(LSP_METAMODEL_PATH ${CMAKE_CURRENT_BINARY_DIR}/metaModel.json) | ||
set(LSP_DATASTRUCT_ROOT ${CMAKE_SOURCE_DIR}/lsp-server/include/types) | ||
set(LSP_DATASTRUCT_CMAKE ${LSP_DATASTRUCT_ROOT}/generated_headers.cmake) | ||
|
||
if(NOT EXISTS ${LSP_DATASTRUCT_CMAKE} OR NOT EXISTS ${LSP_METAMODEL_PATH}) | ||
|
||
message(STATUS "Regenerating LSP data structures using " ${LSP_METAMODEL_PATH}) | ||
file( | ||
DOWNLOAD https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/metaModel/metaModel.json | ||
${LSP_METAMODEL_PATH} | ||
) | ||
|
||
execute_process(COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/LSPGen/main.py -fo ${LSP_DATASTRUCT_ROOT} ${LSP_METAMODEL_PATH}) | ||
message(STATUS "Regeneration done. ") | ||
|
||
endif() | ||
|
||
include(${LSP_DATASTRUCT_CMAKE}) | ||
list(TRANSFORM SVLS_GEN_HEADERS PREPEND ${LSP_DATASTRUCT_ROOT}/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
create_component(sv-explorer | ||
LIB_SRC | ||
PRIVATE explorer/hier_visitor.cpp | ||
LIB_INC | ||
INTERFACE explorer/ | ||
LIB_LINK | ||
PUBLIC slang::slang | ||
PUBLIC nlohmann_json::nlohmann_json | ||
EXE_SRC | ||
PRIVATE explorer/main.cpp | ||
PRIVATE explorer/explorer_visitor.cpp | ||
EXE_INC | ||
PRIVATE utils/ast-printer | ||
EXE_LINK | ||
PRIVATE slang::slang | ||
PRIVATE nlohmann_json::nlohmann_json | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
create_component(sv-formatter | ||
LIB_SRC | ||
PRIVATE formatter/format_DataDeclaration.cpp | ||
PRIVATE formatter/spacing_manager.cpp | ||
LIB_INC | ||
INTERFACE formatter/ | ||
LIB_LINK | ||
PUBLIC slang::slang | ||
EXE_SRC | ||
PRIVATE utils/ast-printer/ast_print.cpp | ||
PRIVATE formatter/main_formatter.cpp | ||
EXE_INC | ||
PRIVATE utils/ast-printer | ||
EXE_LINK | ||
PRIVATE argparse::argparse | ||
PRIVATE fmt::fmt | ||
PRIVATE spdlog::spdlog | ||
PRIVATE slang::slang | ||
PRIVATE sv-formatter-lib | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
create_component(sv-indexer | ||
LIB_SRC | ||
PRIVATE indexer/index_elements.cpp | ||
PRIVATE indexer/diplomat_index.cpp | ||
PRIVATE indexer/visitor_index.cpp | ||
LIB_INC | ||
PUBLIC indexer/include | ||
LIB_LINK | ||
PUBLIC slang::slang | ||
PUBLIC nlohmann_json::nlohmann_json | ||
spdlog::spdlog | ||
EXE_SRC | ||
PRIVATE indexer/main_indexer.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
include(FetchContent) | ||
|
||
# Base library, might be used as dependencies for others | ||
|
||
|
||
FetchContent_Declare(fmt | ||
GIT_REPOSITORY https://github.com/fmtlib/fmt.git | ||
#GIT_TAG 10.2.1 # For correct management with slang | ||
GIT_TAG 11.0.2 | ||
GIT_SHALLOW ON) | ||
|
||
FetchContent_Declare(network | ||
GIT_REPOSITORY https://github.com/fpagliughi/sockpp.git | ||
GIT_TAG v1.0.0 | ||
GIT_SHALLOW ON) | ||
|
||
FetchContent_Declare(spdlog | ||
GIT_REPOSITORY https://github.com/gabime/spdlog.git | ||
GIT_TAG v1.14.1 | ||
GIT_SHALLOW ON) | ||
|
||
FetchContent_Declare(json | ||
GIT_REPOSITORY https://github.com/nlohmann/json.git | ||
GIT_TAG v3.11.3 | ||
GIT_SHALLOW ON) | ||
|
||
FetchContent_Declare(uri | ||
GIT_REPOSITORY https://github.com/ben-zen/uri-library.git | ||
GIT_TAG 6b1b15a | ||
GIT_SHALLOW OFF) | ||
|
||
FetchContent_Declare(uuid | ||
GIT_REPOSITORY https://github.com/mariusbancila/stduuid.git | ||
GIT_TAG v1.2.3 | ||
GIT_SHALLOW ON) | ||
|
||
# Core feature providers | ||
FetchContent_Declare( slang | ||
GIT_REPOSITORY https://github.com/MikePopoloski/slang.git | ||
GIT_TAG v7.0 | ||
GIT_SHALLOW ON) | ||
|
||
|
||
FetchContent_Declare(argparse | ||
GIT_REPOSITORY https://github.com/p-ranav/argparse.git | ||
GIT_TAG v3.1 | ||
GIT_SHALLOW ON) | ||
|
||
FetchContent_MakeAvailable(uri) | ||
|
||
# FetchContent_MakeAvailable(pgm-index) | ||
|
||
FetchContent_MakeAvailable(fmt network uuid) | ||
FetchContent_MakeAvailable(json spdlog) | ||
FetchContent_MakeAvailable(argparse slang) | ||
|
||
include_directories($<BUILD_INTERFACE:${uri_SOURCE_DIR}>) |
Oops, something went wrong.