Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default for BUILD_TESTS to OFF. #3316

Merged
merged 6 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMake/TestError.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# A very simple script to issue an error if the mlpack_test target is not
# defined.
message(FATAL_ERROR "To build the mlpack_test target, reconfigure CMake with the BUILD_TESTS option set to ON! (i.e. `cmake -DBUILD_TESTS=ON ../`)")
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ option(DEBUG "Compile with debugging information." OFF)
option(PROFILE "Compile with profiling information." OFF)
option(ARMA_EXTRA_DEBUG "Compile with extra Armadillo debugging symbols." OFF)
option(TEST_VERBOSE "Run test cases with verbose output." OFF)
option(BUILD_TESTS "Build tests." ON)
option(BUILD_TESTS "Build tests." OFF)
conradsnicta marked this conversation as resolved.
Show resolved Hide resolved
option(BUILD_CLI_EXECUTABLES "Build command-line executables." ON)
option(DOWNLOAD_DEPENDENCIES "Automatically download dependencies if not available." OFF)
option(BUILD_GO_SHLIB "Build Go shared library." OFF)
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
###### ????-??-??
* Fix mapping of categorical data for Julia bindings (#3305).

* Set `BUILD_TESTS` to `OFF` by default. If you want to build tests, like
`mlpack_test`, manually set `BUILD_TESTS` to `ON` in your CMake
configuration step (#3316).

### mlpack 4.0.0
###### 2022-10-23
* Bump C++ standard requirement to C++14 (#3233).
Expand Down
5 changes: 5 additions & 0 deletions src/mlpack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ add_subdirectory(methods)
# If necessary, configure the tests.
if (BUILD_TESTS)
add_subdirectory(tests)
else ()
# Add convenience target to tell the user they need BUILD_TESTS if they try to
# build mlpack_test.
add_custom_target(mlpack_test
${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/CMake/TestError.cmake)
endif ()

# At install time, we simply install the src/ directory to include/ (though we
Expand Down
1 change: 0 additions & 1 deletion src/mlpack/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(CTest)

# mlpack test executable.
add_executable(mlpack_test
EXCLUDE_FROM_ALL
${MLPACK_TEST_SRCS}

# Tests for neural network code (and reinforcement learning code).
Expand Down