From 65994b1e83f09d308ae97f7056bf137c152f2760 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 15 Nov 2023 18:49:14 +0800 Subject: [PATCH] build: cmake: add compatibility target of dev-headers our CI builds "dev-headers" as a gating check. but the target names generated by CMake's Ninja Multi-Config generator does not follow this naming convention. we could have headers:Dev, but still, it's different from what we are using, before completely switching to CMake, let's keep this backward compatibility by adding a target with the same name. Signed-off-by: Kefu Chai --- CMakeLists.txt | 9 +++++++++ configure.py | 1 + 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57d495e899..73a461759c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,15 @@ option(Scylla_CHECK_HEADERS "Add check-headers target for checking the self-containness of headers") if(Scylla_CHECK_HEADERS) add_custom_target(check-headers) + # compatibility target used by CI, which builds "dev-headers" for building + # "headers" of the "dev" mode. but we don't have such an alias. what we + # have is check-headers:Dev, and we don't want to build check-headers + # for all "CMAKE_DEFAULT_CONFIGS". so, before we , let's add an target + # which only build build check-headers for Dev, and skip it otherwise. + add_custom_target(dev-headers + COMMAND ${CMAKE_COMMAND} + "$,--build;${CMAKE_BINARY_DIR};--config;$;--target;check-headers,-E;echo;skipping;dev-headers;in;$>" + COMMAND_EXPAND_LISTS) endif() include(check_headers) diff --git a/configure.py b/configure.py index 182551f397..34d5f03205 100755 --- a/configure.py +++ b/configure.py @@ -2426,6 +2426,7 @@ def configure_using_cmake(args): 'CMAKE_CXX_FLAGS': args.user_cflags, 'CMAKE_EXE_LINKER_FLAGS': semicolon_separated(args.user_ldflags), 'CMAKE_EXPORT_COMPILE_COMMANDS': 'ON', + 'Scylla_CHECK_HEADERS': 'ON', } if args.date_stamp: settings['Scylla_DATE_STAMP'] = args.date_stamp