Skip to content

Commit

Permalink
cmake: do not build tests by default when cross compiling
Browse files Browse the repository at this point in the history
Since we don't install these, it's not useful to attempt to build them
when we are cross-compiling.

Signed-off-by: Jared Van Bortel <[email protected]>
  • Loading branch information
cebtenzzre committed Jan 15, 2025
1 parent c8ec46b commit ebc7bd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gpt4all-chat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ endif()

find_package(Python3 3.12 QUIET COMPONENTS Interpreter)

option(GPT4ALL_TEST "Build the tests" ${Python3_FOUND})
if (NOT CMAKE_CROSS_COMPILING AND Python3_FOUND)
set(GPT4ALL_TEST_DEFAULT ON)
else()
set(GPT4ALL_TEST_DEFAULT OFF)
endif()

option(GPT4ALL_TEST "Build the tests" ${GPT4ALL_TEST_DEFAULT})
option(GPT4ALL_LOCALHOST "Build installer for localhost repo" OFF)
option(GPT4ALL_OFFLINE_INSTALLER "Build an offline installer" OFF)
option(GPT4ALL_SIGN_INSTALL "Sign installed binaries and installers (requires signing identities)" OFF)
Expand Down

0 comments on commit ebc7bd3

Please sign in to comment.