build: format-check: invoke `make` in a portable way
I've added `uncrustify` to my build environment, and as a result the
build started failing for me because it tried to invoke `make
format-check`. I use the ninja generator for CMake, which means that
there's no `Makefile` generated in my build directory.
Fix this by invoking the relevant target via CMake.
diff --git a/tests/style/CMakeLists.txt b/tests/style/CMakeLists.txt
index e602f24..93d6049 100644
--- a/tests/style/CMakeLists.txt
+++ b/tests/style/CMakeLists.txt
@@ -2,7 +2,7 @@
COMMAND ${CMAKE_SOURCE_DIR}/compat/check_includes.sh ${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/tools/lint/ ${CMAKE_SOURCE_DIR}/tools/re/)
if (${SOURCE_FORMAT_ENABLED})
- add_test(NAME format WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND make format-check)
+ add_test(NAME format WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND cmake --build ${CMAKE_BINARY_DIR} --target format-check)
endif()
# just compile