build: cmake: add dist-* targets to the default build target

also, add a target of `dist-server`, which mirrors the structure
of the targets created by `configure.py`, and it is consistent
with the ones defined by `build_submodule()`.

so that they are built when our CI runs `ninja -C $build`. CI
expects that all these rpm and deb packages to built when
`ninja -C $build` finishes. so that it can continue with
building the container image. let's make it happen. so that
the CMake-based rules can work better with CI.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2024-03-18 12:47:48 +08:00
parent 384e9e9c7c
commit d57a82c156
2 changed files with 5 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ function(build_submodule name dir)
COMMAND reloc/build_deb.sh --reloc-pkg ${reloc_pkg}
DEPENDS ${reloc_pkg}
WORKING_DIRECTORY "${working_dir}")
add_custom_target(dist-${name}
add_custom_target(dist-${name} ALL
DEPENDS dist-${name}-tar dist-${name}-rpm dist-${name}-deb)
endfunction()

6
dist/CMakeLists.txt vendored
View File

@@ -14,7 +14,7 @@ add_custom_command(
${CMAKE_BINARY_DIR}/debian
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(dist-server-deb
add_custom_target(dist-server-deb ALL
# the --builddir should match the paths specified by
# "packages" in dist/docker/debian/build_docker.sh
COMMAND reloc/build_deb.sh
@@ -22,12 +22,14 @@ add_custom_target(dist-server-deb
--builddir ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/debian
DEPENDS ${unstripped_dist_pkg}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(dist-server-rpm
add_custom_target(dist-server-rpm ALL
COMMAND reloc/build_rpm.sh
--reloc-pkg ${unstripped_dist_pkg}
--builddir ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/redhat
DEPENDS ${unstripped_dist_pkg}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(dist-server
DEPENDS dist-server-deb dist-server-rpm)
function(add_stripped name)
# ${name} must be an absolute path