oneDPL icon indicating copy to clipboard operation
oneDPL copied to clipboard

Add a CMake option to disable tests

Open mohd-akram opened this issue 4 years ago • 2 comments

They take a while to build and it would be nice to turn that off.

mohd-akram avatar Dec 22 '21 17:12 mohd-akram

@mohd-akram your request is really reasonable. Could you please clarify the use case where you currently need such option?

I'm asking because there can be multiple ways to solve the original problem [test are always built]:

  1. Add option to control it explicitly (just as you've suggested)
  2. Automatically turn off the tests if oneDPL is included as sub-project through add_subdirectory, keep tests turned on if oneDPL is configured directly.
  3. Exclude tests from all target (so they won't be built in case of make or make all)
  4. Combination of the options above

AlexVeprev avatar Jan 10 '22 12:01 AlexVeprev

When I opened the issue it was for porting oneDPL to MacPorts. Then I realized this is just a header-only library so I just skipped the build step entirely. The oneTBB library has a TBB_TEST option, so I imagine something similar could be used here. Option 3 would likely be ideal, and would negate the need for a separate config flag in my case.

mohd-akram avatar Jan 11 '22 09:01 mohd-akram

This seems fixed, thanks!

mohd-akram avatar Jan 30 '24 23:01 mohd-akram