Skip to content

Commit

Permalink
Make: Add CMake for C builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Aug 4, 2023
1 parent a45fc40 commit 4d2127b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option(USEARCH_INSTALL "Install CMake targets" OFF)
option(USEARCH_BUILD_TEST "Compile a native unit test in C++" ${USEARCH_IS_MAIN_PROJECT})
option(USEARCH_BUILD_BENCHMARK "Compile a native benchmark in C++" ${USEARCH_IS_MAIN_PROJECT})
option(USEARCH_BUILD_WOLFRAM "Compile Wolfram Language bindings" OFF)
option(USEARCH_BUILD_C "Compile a native library for the C 99 interface" OFF)

# Includes
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
Expand Down Expand Up @@ -122,3 +123,7 @@ endif()
if(${USEARCH_BUILD_WASM})
add_subdirectory(wasm)
endif()

if(${USEARCH_BUILD_C})
add_subdirectory(c)
endif()
4 changes: 1 addition & 3 deletions docs/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ GoLang bindings are based on C.
So one should first compile the C library, link it with GoLang, and only then run tests.

```sh
cd golang
make -C ../c build && mv ../c/libusearch.so libusearch.so
go test -v
cd golang && make -C ../c build && mv ../c/libusearch.so libusearch.so && go test -v
```

## Wolfram
Expand Down

0 comments on commit 4d2127b

Please sign in to comment.