yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.22k stars 112 forks source link

Building bin/qbg is happening even with NGT_QBG_DISABLED #157

Closed lerouxrgd closed 2 months ago

lerouxrgd commented 2 months ago

Hello,

I noticed that even though I set NGT_QBG_DISABLED=ON CMake will build bin/qbg due to:

add_subdirectory("${PROJECT_SOURCE_DIR}/bin/qbg")

This actually prevents ngt-rs from building without QBG (testing with cargo test) when using NGT 2.2.1. You can actually test it locally on this branch.

I guess the cause is the following if statement:

    if(NOT DEFINED NGT_SHARED_MEMORY_ALLOCATOR OR (NOT ${NGT_SHARED_MEMORY_ALLOCATOR}))
        add_subdirectory("${PROJECT_SOURCE_DIR}/bin/qbg")
        endif()

Would it be possible to check NGT_QBG_DISABLED instead of NGT_SHARED_MEMORY_ALLOCATOR in this if statement ?

masajiro commented 2 months ago

Hello, Thank you for your helpful comment to solve this issue. I have released V2.2.2 for this issue.

lerouxrgd commented 2 months ago

Thank you for the fix ! I can build it correctly now !