Skip to content

Commit

Permalink
fix: ninja build
Browse files Browse the repository at this point in the history
When CMAKE_GENERATOR is Ninja, CMAKE_MAKE_PROGRAM is ninja, and all the
ExternalProject_Add commands utterly fail.

Signed-off-by: Angelo Puglisi <[email protected]>
  • Loading branch information
deepskyblue86 authored and poiana committed Nov 1, 2023
1 parent 0a7b8ef commit 17590f3
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/cares.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ else()
URL "https://c-ares.haxx.se/download/c-ares-1.19.1.tar.gz"
URL_HASH "SHA256=321700399b72ed0e037d0074c629e7741f6b2ec2dda92956abe3e9671d3e268e"
CONFIGURE_COMMAND CPPFLAGS=${CARES_CPPFLAGS} ./configure ${CARES_STATIC_OPTION} --prefix=${CARES_INSTALL_DIR}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${CARES_INCLUDE} ${CARES_LIB}
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install)
INSTALL_COMMAND make install)
install(FILES "${CARES_LIB}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps")
install(DIRECTORY "${CARES_INCLUDE}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}"
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/curl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ else()
--disable-threaded-resolver
--without-brotli
--without-zstd
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${CURL_LIBRARIES}
INSTALL_COMMAND "")
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/grpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ else()
# Keep installation files into the local ${GRPC_INSTALL_DIR}
# since here is the case when we are embedding gRPC
UPDATE_COMMAND ""
INSTALL_COMMAND DESTDIR= ${CMAKE_MAKE_PROGRAM} install
INSTALL_COMMAND DESTDIR= make install
)
install(FILES ${GRPC_MAIN_LIBS} DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps")
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/jq.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ else()
URL "https://download.falco.org/dependencies/jq-1.6.tar.gz"
URL_HASH "SHA256=787518068c35e244334cc79b8e56b60dbab352dff175b7f04a94f662b540bfd9"
CONFIGURE_COMMAND CPPFLAGS=${CPPFLAGS} ./configure --disable-maintainer-mode ${JQ_STATIC_OPTION} --disable-dependency-tracking --with-oniguruma=builtin --prefix=${JQ_INSTALL_DIR}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} clean all LDFLAGS=${JQ_LDFLAGS}
BUILD_COMMAND make clean all LDFLAGS=${JQ_LDFLAGS}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${JQ_LIB} ${ONIGURUMA_LIB}
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install)
INSTALL_COMMAND make install)
install(FILES "${JQ_LIB}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps")
install(FILES "${ONIGURUMA_LIB}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/jsoncpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ else()
-DJSONCPP_WITH_POST_BUILD_UNITTEST=Off
-DCMAKE_INSTALL_PREFIX=${JSONCPP_SRC}
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_BYPRODUCTS ${JSONCPP_LIB}
)
else()
# see: https://cmake.org/cmake/help/latest/policy/CMP0091.html
Expand Down
3 changes: 2 additions & 1 deletion cmake/modules/libbpf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ else()
URL_HASH
"SHA256=32b0c41eabfbbe8e0c8aea784d7495387ff9171b5a338480a8fbaceb9da8d5e5"
CONFIGURE_COMMAND mkdir -p build root
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} BUILD_STATIC_ONLY=y OBJDIR=${LIBBPF_BUILD_DIR}/build DESTDIR=${LIBBPF_BUILD_DIR}/root NO_PKG_CONFIG=1 "EXTRA_CFLAGS=-fPIC -I${LIBELF_INCLUDE} -I${ZLIB_INCLUDE}" "LDFLAGS=-Wl,-Bstatic" "EXTRA_LDFLAGS=-L${LIBELF_SRC}/libelf/libelf -L${ZLIB_SRC}" -C ${LIBBPF_SRC}/libbpf/src install install_uapi_headers
BUILD_COMMAND make BUILD_STATIC_ONLY=y OBJDIR=${LIBBPF_BUILD_DIR}/build DESTDIR=${LIBBPF_BUILD_DIR}/root NO_PKG_CONFIG=1 "EXTRA_CFLAGS=-fPIC -I${LIBELF_INCLUDE} -I${ZLIB_INCLUDE}" "LDFLAGS=-Wl,-Bstatic" "EXTRA_LDFLAGS=-L${LIBELF_SRC}/libelf/libelf -L${ZLIB_SRC}" -C ${LIBBPF_SRC}/libbpf/src install install_uapi_headers
INSTALL_COMMAND ""
UPDATE_COMMAND ""
BUILD_BYPRODUCTS ${LIBBPF_LIB}
)
message(STATUS "Using bundled libbpf: include'${LIBBPF_INCLUDE}', lib: ${LIBBPF_LIB}")
install(FILES "${LIBBPF_LIB}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
Expand Down
5 changes: 3 additions & 2 deletions cmake/modules/libelf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ else()
URL_HASH "SHA256=39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8"
CONFIGURE_COMMAND ./configure LDFLAGS=-L${ZLIB_SRC} "CFLAGS=-I${ZLIB_INCLUDE}" --enable-deterministic-archives --disable-debuginfod --disable-libdebuginfod --without-zstd
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} -C lib libeu.a
COMMAND ${CMAKE_MAKE_PROGRAM} -C libelf libelf${LIBELF_LIB_SUFFIX}
BUILD_COMMAND make -C lib libeu.a
COMMAND make -C libelf libelf${LIBELF_LIB_SUFFIX}
INSTALL_COMMAND ""
UPDATE_COMMAND ""
BUILD_BYPRODUCTS ${LIBELF_LIB}
)
message(STATUS "Using bundled libelf: include'${LIBELF_INCLUDE}', lib: ${LIBELF_LIB}")
install(FILES "${LIBELF_LIB}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
Expand Down
6 changes: 3 additions & 3 deletions cmake/modules/luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else()
GIT_REPOSITORY "https://github.com/moonjit/moonjit"
GIT_TAG "2.1.2"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
UPDATE_COMMAND ""
Expand All @@ -61,7 +61,7 @@ else()
GIT_REPOSITORY "https://github.com/linux-on-ibm-z/LuaJIT.git"
GIT_TAG "v2.1"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
UPDATE_COMMAND ""
Expand All @@ -82,7 +82,7 @@ else()
GIT_REPOSITORY "https://github.com/LuaJIT/LuaJIT"
GIT_TAG "f3c856915b4ce7ccd24341e8ac73e8a9fd934171"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
UPDATE_COMMAND ""
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/openssl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ else()
URL "https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz"
URL_HASH "SHA256=a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539"
CONFIGURE_COMMAND ./config ${OPENSSL_SHARED_OPTION} --prefix=${OPENSSL_INSTALL_DIR} --libdir=lib
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${OPENSSL_LIBRARY_SSL} ${OPENSSL_LIBRARY_CRYPTO}
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install_sw)
INSTALL_COMMAND make install_sw)
install(FILES "${OPENSSL_LIBRARY_SSL}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps")
install(FILES "${OPENSSL_LIBRARY_CRYPTO}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else()
URL_HASH "SHA256=51cec99f108b83422b7af1170afd7aeb2dd77d2bcbb7b6bad1f92509e9ccf8cb"
# TODO what if using system zlib?
CONFIGURE_COMMAND CPPFLAGS=-I${ZLIB_INCLUDE} LDFLAGS=-L${ZLIB_SRC} ./configure --with-zlib ${PROTOBUF_CONFIGURE_FLAGS} --prefix=${PROTOBUF_INSTALL_DIR}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${PROTOC} ${PROTOBUF_INCLUDE} ${PROTOBUF_LIB}
INSTALL_COMMAND make install)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/zlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ else()
URL "https://github.com/madler/zlib/archive/v1.2.13.tar.gz"
URL_HASH "SHA256=1525952a0a567581792613a9723333d7f8cc20b87a81f920fb8bc7e3f2251428"
CONFIGURE_COMMAND ./configure --prefix=${ZLIB_SRC} ${ZLIB_CONFIGURE_FLAGS}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${ZLIB_LIB}
INSTALL_COMMAND "")
Expand Down

0 comments on commit 17590f3

Please sign in to comment.