hwloc
hwloc copied to clipboard
improve Windows CMake support
Here's a list of things that we may want to improve in the Windows CMake support:
- Include contrib/windows/app.manifest so that our apps say they are compatible with Windows10 (required before using the "efficieny class" on hybrid CPUs). Without this manifest, they just report Windows <=7 support (we can't know if the efficiency class is actually supported). We have a workaround to detect the Windows version but it uses an unofficial method (RtlGetVersion) so I'd like to make the correct codepath work.
- autotools only builds unit test during make check, while CMake builds them during the main build instead of during CTest. Is this expected?
- we'd need to include the soname version in the library filename (libhwloc-15.dll in current hwloc 2.x).
@scivision @Neumann-A
re: make check, in CMake this is done distinctively. Normally I just build everything including the test targets on CI by setting/defaulting the HWLOC_ENABLE_TESTING=on.
To build it in two separate steps as follows, though this is less commonly done, nothing wrong with it, just extra typing.
To build without tests
cmake -B build -DHWLOC_ENABLE_TESTING=off
cmake --build build
to build and run tests
cmake -B build -DHWLOC_ENABLE_TESTING=on
cmake --build build
ctest --test-dir build
In short, for a project where there are a lot of test targets like HWLOC, one might set the default
option(HWLOC_BUILD_TESTING "build test targets" OFF)
the soname suffix is also a straightforward parameter to set in CMake.
for the app.manifest file, is this something you want "make install" to copy into a file path location with the HWLOC binaries? This is also straightforward in CMake.