Skip to content

Commit d7b8103

Browse files
committed
chore: Move the lsp server to src/lsp module
So it can be used by the emscripten bindings. Signed-off-by: Roberto Raggi <[email protected]>
1 parent fe838cc commit d7b8103

File tree

10 files changed

+14
-12
lines changed

10 files changed

+14
-12
lines changed

src/frontend/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ add_executable(cxx ${SOURCES})
2323

2424
target_link_libraries(cxx PRIVATE cxx-parser cxx-lsp)
2525

26-
target_compile_definitions(cxx PRIVATE
27-
CXX_VERSION="${CMAKE_PROJECT_VERSION}"
28-
)
29-
30-
# if cmake founds the Threads package, link with it
31-
if(Threads_FOUND)
32-
target_link_libraries(cxx PRIVATE Threads::Threads)
33-
else()
34-
target_compile_definitions(cxx PRIVATE CXX_NO_THREADS)
35-
endif()
36-
3726
if(EMSCRIPTEN)
3827
target_link_options(cxx PRIVATE
3928
"SHELL:-s EXIT_RUNTIME=1"

src/frontend/cxx/frontend.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <cxx/control.h>
2525
#include <cxx/gcc_linux_toolchain.h>
2626
#include <cxx/lexer.h>
27+
#include <cxx/lsp/lsp_server.h>
2728
#include <cxx/macos_toolchain.h>
2829
#include <cxx/preprocessor.h>
2930
#include <cxx/private/path.h>
@@ -43,7 +44,6 @@
4344
#include <string>
4445

4546
#include "ast_printer.h"
46-
#include "lsp_server.h"
4747
#include "verify_diagnostics_client.h"
4848

4949
namespace {

src/lsp/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ add_library(cxx-lsp
2626
${CXX_LSP_INCLUDE_HEADER_FILES}
2727
)
2828

29+
target_link_libraries(cxx-lsp PUBLIC cxx-parser)
30+
31+
# if cmake founds the Threads package, link with it
32+
if(Threads_FOUND)
33+
target_link_libraries(cxx-lsp PUBLIC Threads::Threads)
34+
else()
35+
target_compile_definitions(cxx-lsp PUBLIC CXX_NO_THREADS)
36+
endif()
37+
2938
target_include_directories(cxx-lsp
3039
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
3140
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/parser/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ add_library(cxx-parser ${SOURCES}
2727
pp_keywords-priv.h
2828
)
2929

30+
target_compile_definitions(cxx-parser PUBLIC
31+
CXX_VERSION="${CMAKE_PROJECT_VERSION}"
32+
)
33+
3034
target_include_directories(cxx-parser
3135
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
3236
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

0 commit comments

Comments
 (0)