From 404fdb0f3683094c2d40e1ee7e41d5c491f41a06 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 24 Nov 2023 13:28:15 +0100 Subject: build: cmake fixes - add EXTERNALPROJECT_OPTIONS variable to main build - use `REQUIRED` keyword for IWYU. - remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS` is `ON`. If we explicitly enable it then we probably want it to give an error if it doesn't exist, rather than silently skip it. - Move dependency interface libraries to their find module and use them as a pseudo-imported target. - Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it again if something similar is needed. - Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version` output. --- cmake/FindLibintl.cmake | 6 ++++++ cmake/FindLibuv.cmake | 4 ++++ cmake/RunTests.cmake | 6 +----- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'cmake') diff --git a/cmake/FindLibintl.cmake b/cmake/FindLibintl.cmake index 630a3545fc..faee0537ff 100644 --- a/cmake/FindLibintl.cmake +++ b/cmake/FindLibintl.cmake @@ -78,3 +78,9 @@ endif() find_package_handle_standard_args(Libintl DEFAULT_MSG ${REQUIRED_VARIABLES}) mark_as_advanced(LIBINTL_LIBRARY LIBINTL_INCLUDE_DIR) + +add_library(libintl INTERFACE) +target_include_directories(libintl SYSTEM BEFORE INTERFACE ${LIBINTL_INCLUDE_DIR}) +if (LIBINTL_LIBRARY) + target_link_libraries(libintl INTERFACE ${LIBINTL_LIBRARY}) +endif() diff --git a/cmake/FindLibuv.cmake b/cmake/FindLibuv.cmake index 1913d564f2..dcd9b9559d 100644 --- a/cmake/FindLibuv.cmake +++ b/cmake/FindLibuv.cmake @@ -61,3 +61,7 @@ find_package_handle_standard_args(Libuv DEFAULT_MSG LIBUV_LIBRARY LIBUV_INCLUDE_DIR) mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY) + +add_library(libuv INTERFACE) +target_include_directories(libuv SYSTEM BEFORE INTERFACE ${LIBUV_INCLUDE_DIR}) +target_link_libraries(libuv INTERFACE ${LIBUV_LIBRARIES}) diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 8d5b0d2402..fdf47263a1 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -32,10 +32,6 @@ if(IS_ABSOLUTE ${TEST_PATH}) file(RELATIVE_PATH TEST_PATH "${WORKING_DIR}" "${TEST_PATH}") endif() -if(BUSTED_OUTPUT_TYPE STREQUAL junit) - set(EXTRA_ARGS OUTPUT_FILE ${BUILD_DIR}/${TEST_TYPE}test-junit.xml) -endif() - set(BUSTED_ARGS $ENV{BUSTED_ARGS}) separate_arguments(BUSTED_ARGS) @@ -72,7 +68,7 @@ endif() execute_process( # Note: because of "-ll" (low-level interpreter mode), some modules like # _editor.lua are not loaded. - COMMAND ${NVIM_PRG} -ll ${WORKING_DIR}/test/lua_runner.lua ${DEPS_INSTALL_DIR} busted -v -o test.busted.outputHandlers.${BUSTED_OUTPUT_TYPE} + COMMAND ${NVIM_PRG} -ll ${WORKING_DIR}/test/lua_runner.lua ${DEPS_INSTALL_DIR} busted -v -o test.busted.outputHandlers.nvim --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua --lpath=${BUILD_DIR}/?.lua --lpath=${WORKING_DIR}/runtime/lua/?.lua -- cgit