-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Description
The "ONNX_MLIR_BUILD_TESTS" setting is documented as controlling whether the test executables are built. But it doesn't appear to be honored. A couple of problems:
- It's only tested in
docs/doc_example/CMakeLists.txt
andtest/multiple-models/CMakeLists.txt
- When it's ON, the logic sets
set(EXCLUDE_FROM_ALL ON)
. The CMake documentation forEXCLUDE_FROM_ALL
says that it's either a property on a target (documentation), or a property on a directory (documentation) - andset(EXCLUDE_FROM_ALL ON)
sets neither.
It looks like a fix would be to:
- Test it in
docs/doc_example/CMakeLists.txt
andtest/CMakeLists.txt
- Set the property on the directory with (for example):
# If 'ONNX_MLIR_BUILD_TESTS' is ON, set 'EXCLUDE_FROM_ALL' for this directory. This will allow test targets to be
# defined, but 'all' will not depend on them by default.
if (NOT ONNX_MLIR_BUILD_TESTS)
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON)
endif()
This problem manifests for me with a Visual Studio Generator, and the fix fixes it. I'll double check with a Ninja Generator. I'm happy to send the fix; wondering if others see this problem...?
seanshpark
Metadata
Metadata
Assignees
Labels
No labels