Skip to content

Commit

Permalink
Disable chemfiles by default when building the C/C++ API
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Aug 29, 2023
1 parent 7168a12 commit c137e31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rascaline-c-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ set(RUST_BUILD_TARGET "" CACHE STRING "Cross-compilation target for rust code. L
set(EXTRA_RUST_FLAGS "" CACHE STRING "Flags used to build rust code")
mark_as_advanced(RUST_BUILD_TARGET EXTRA_RUST_FLAGS)

option(RASCALINE_ENABLE_CHEMFILES "Disable the usage of chemfiles for reading structures from files" ON)
option(RASCALINE_ENABLE_CHEMFILES "Enable the usage of chemfiles for reading structures from files" OFF)
option(RASCALINE_FETCH_EQUISTORE "Download and build the equistore C API before building rascaline" OFF)

set(CMAKE_MACOSX_RPATH ON)
Expand Down
1 change: 1 addition & 0 deletions rascaline-c-api/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ else()
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
endif()

set(RASCALINE_ENABLE_CHEMFILES ON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/rascaline)


Expand Down
3 changes: 2 additions & 1 deletion rascaline/src/systems/chemfiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ pub fn read_from_file(path: impl AsRef<Path>) -> Result<Vec<SimpleSystem>, Error
#[cfg(not(feature = "chemfiles"))]
pub fn read_from_file(_: impl AsRef<Path>) -> Result<Vec<SimpleSystem>, Error> {
Err(Error::Chemfiles(
"read_from_file is only available with the chemfiles feature enabled".into()
"read_from_file is only available with the chemfiles feature enabled \
(RASCALINE_ENABLE_CHEMFILES=ON in CMake)".into()
))
}

Expand Down

0 comments on commit c137e31

Please sign in to comment.