asg017 / sqlite-vec

A vector search SQLite extension that runs anywhere!
Apache License 2.0
4.24k stars 134 forks source link

Add CMake #118

Open thesmartwon opened 1 month ago

thesmartwon commented 1 month ago

I'm interested in building your project on Windows. Would you be interested in replacing Makefile with CMakeLists.txt? If so, I could pick up the work.

As an aside, to build WASM on Linux, I had to add -I/usr/include to emcc:

 $(TARGET_WASM_LIB): examples/wasm/wasm.c sqlite-vec.c $(BUILD_DIR) $(WASM_DIR)
-       emcc -O3  -I./ -Ivendor -DSQLITE_CORE -c examples/wasm/wasm.c -o $(BUILD_DIR)/wasm.wasm.o
-       emcc -O3  -I./ -Ivendor -DSQLITE_CORE -c sqlite-vec.c -o $(BUILD_DIR)/sqlite-vec.wasm.o
+       emcc -O3  -I./ -Ivendor -I/usr/include -DSQLITE_CORE -c examples/wasm/wasm.c -o $(BUILD_DIR)/wasm.wasm.o
+       emcc -O3  -I./ -Ivendor -I/usr/include -DSQLITE_CORE -c sqlite-vec.c -o $(BUILD_DIR)/sqlite-vec.wasm.o
        emar rcs $@ $(BUILD_DIR)/wasm.wasm.o $(BUILD_DIR)/sqlite-vec.wasm.o