Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: disable scripts #2550

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ if(${ENABLE_LTO})
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

option(AUTO_UPDATE_GRAMMAR "Automatically regenerate C++ grammar files on change." TRUE)
option(BUILD_BENCHMARK "Build benchmarks." FALSE)
option(BUILD_EXAMPLES "Build examples." FALSE)
option(BUILD_JAVA "Build Java API." FALSE)
option(BUILD_NODEJS "Build NodeJS API." FALSE)
option(BUILD_PYTHON "Build Python API." FALSE)
option(BUILD_SHELL "Build Interactive Shell" TRUE)
option(BUILD_SINGLE_FILE_HEADER "Build single file header. Requires Python >= 3.9." TRUE)
option(BUILD_TESTS "Build C++ tests." FALSE)

option(BUILD_LCOV "Build coverage report." FALSE)
Expand Down
24 changes: 13 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ endif()

install(TARGETS kuzu kuzu_shared)

# Create a command to generate kuzu.hpp, and then create a target that is
# always built that depends on it. This allows our generator to detect when
# exactly to build kuzu.hpp, while still building the target by default.
find_package(Python3 3.9...4 REQUIRED)
add_custom_command(
OUTPUT kuzu.hpp
COMMAND
${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/collect-single-file-header.py
DEPENDS
${PROJECT_SOURCE_DIR}/scripts/collect-single-file-header.py kuzu_shared)
add_custom_target(single_file_header ALL DEPENDS kuzu.hpp)
if(${BUILD_SINGLE_FILE_HEADER})
# Create a command to generate kuzu.hpp, and then create a target that is
# always built that depends on it. This allows our generator to detect when
# exactly to build kuzu.hpp, while still building the target by default.
find_package(Python3 3.9...4 REQUIRED)
add_custom_command(
OUTPUT kuzu.hpp
COMMAND
${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/collect-single-file-header.py
DEPENDS
${PROJECT_SOURCE_DIR}/scripts/collect-single-file-header.py kuzu_shared)
add_custom_target(single_file_header ALL DEPENDS kuzu.hpp)
endif()

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kuzu.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/c_api/kuzu.h TYPE INCLUDE)
24 changes: 13 additions & 11 deletions third_party/antlr4_cypher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
add_custom_command(
OUTPUT
${CMAKE_CURRENT_SOURCE_DIR}/cypher_lexer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cypher_parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/include/cypher_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/include/cypher_parser.h
COMMAND cmake -D ROOT_DIR=${PROJECT_SOURCE_DIR} -P generate_grammar.cmake
DEPENDS
${PROJECT_SOURCE_DIR}/src/antlr4/Cypher.g4
${PROJECT_SOURCE_DIR}/scripts/antlr4/generate_grammar.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/antlr4)
if(${AUTO_UPDATE_GRAMMAR})
add_custom_command(
OUTPUT
${CMAKE_CURRENT_SOURCE_DIR}/cypher_lexer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cypher_parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/include/cypher_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/include/cypher_parser.h
COMMAND cmake -D ROOT_DIR=${PROJECT_SOURCE_DIR} -P generate_grammar.cmake
DEPENDS
${PROJECT_SOURCE_DIR}/src/antlr4/Cypher.g4
${PROJECT_SOURCE_DIR}/scripts/antlr4/generate_grammar.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/antlr4)
endif()

add_library(antlr4_cypher
STATIC
Expand Down
6 changes: 5 additions & 1 deletion tools/rust_api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ fn build_bundled_cmake() -> Result<Vec<PathBuf>, Box<dyn std::error::Error>> {
};

let mut build = cmake::Config::new(&kuzu_root);
build.no_build_target(true).define("BUILD_SHELL", "OFF");
build
.no_build_target(true)
.define("BUILD_SHELL", "OFF")
.define("BUILD_SINGLE_FILE_HEADER", "OFF")
.define("AUTO_UPDATE_GRAMMAR", "OFF");
if cfg!(windows) {
build.generator("Ninja");
build.cxxflag("/EHsc");
Expand Down
Loading