-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support build dependencies from source
- Loading branch information
Showing
19 changed files
with
350 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
find_path(CURL_INCLUDE_DIRS curl/curl.h) | ||
|
||
find_library(CURL_LIBRARIES curl) | ||
|
||
find_package_handle_standard_args(curl DEFAULT_MSG CURL_LIBRARIES CURL_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(CURL_INCLUDE_DIRS CURL_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
if (LIBE2FS_PATH) | ||
find_path(LIBE2FS_INCLUDE_DIRS ext2fs/ext2fs.h HINTS ${LIBE2FS_PATH}/include) | ||
find_library(LIBE2FS_LIBRARIES ext2fs HINTS ${LIBE2FS_PATH}/lib) | ||
else() | ||
find_path(LIBE2FS_INCLUDE_DIRS ext2fs/ext2fs.h) | ||
find_library(LIBE2FS_LIBRARIES ext2fs) | ||
endif() | ||
find_path(E2FS_INCLUDE_DIRS ext2fs/ext2fs.h) | ||
|
||
find_package_handle_standard_args(e2fs DEFAULT_MSG LIBE2FS_LIBRARIES LIBE2FS_INCLUDE_DIRS) | ||
find_library(E2FS_LIBRARIES ext2fs) | ||
|
||
mark_as_advanced(LIBE2FS_INCLUDE_DIRS LIBE2FS_LIBRARIES) | ||
find_package_handle_standard_args(e2fs DEFAULT_MSG E2FS_LIBRARIES E2FS_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(E2FS_INCLUDE_DIRS E2FS_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
pkg_check_modules(DPDK REQUIRED libdpdk) | ||
|
||
find_path(FSTACK_INCLUDE_DIRS NAMES ff_api.h PATHS /usr/local/include NO_DEFAULT_PATH) | ||
|
||
find_library(FSTACK_LIBRARIES NAMES fstack PATHS /usr/local/lib NO_DEFAULT_PATH) | ||
|
||
set(FSTACK_INCLUDE_DIRS ${FSTACK_INCLUDE_DIRS} ${DPDK_INCLUDE_DIRS}) | ||
|
||
set(FSTACK_LIBRARIES ${FSTACK_LIBRARIES} ${DPDK_STATIC_LDFLAGS}) | ||
|
||
find_package_handle_standard_args(fstack DEFAULT_MSG FSTACK_LIBRARIES FSTACK_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(FSTACK_INCLUDE_DIRS FSTACK_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
find_path(GOOGLETEST_INCLUDE_DIRS gtest/gtest.h gmock/gmock.h) | ||
|
||
find_library(GOOGLETEST_GTEST_LIBRARIES gtest) | ||
find_library(GOOGLETEST_GTEST_MAIN_LIBRARIES gtest_main) | ||
find_library(GOOGLETEST_GMOCK_LIBRARIES gmock) | ||
find_library(GOOGLETEST_GMOCK_MAIN_LIBRARIES gmock_main) | ||
|
||
set(GOOGLETEST_LIBRARIES | ||
${GOOGLETEST_GTEST_LIBRARIES} | ||
${GOOGLETEST_GTEST_MAIN_LIBRARIES} | ||
${GOOGLETEST_GMOCK_LIBRARIES} | ||
${GOOGLETEST_GMOCK_MAIN_LIBRARIES} | ||
) | ||
|
||
find_package_handle_standard_args(googletest DEFAULT_MSG GOOGLETEST_LIBRARIES GOOGLETEST_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(GOOGLETEST_INCLUDE_DIRS GOOGLETEST_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
find_path(OPENSSL_INCLUDE_DIRS openssl/ssl.h openssl/crypto.h) | ||
|
||
find_library(OPENSSL_SSL_LIBRARIES ssl) | ||
find_library(OPENSSL_CRYPTO_LIBRARIES crypto) | ||
|
||
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES}) | ||
|
||
find_package_handle_standard_args(openssl DEFAULT_MSG OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(OPENSSL_INCLUDE_DIRS OPENSSL_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,7 @@ | ||
# * Find liburing Find the liburing library and includes | ||
# | ||
# URING_INCLUDE_DIR - where to find liburing.h, etc. URING_LIBRARIES - List of | ||
# libraries when using uring. URING_FOUND - True if uring found. | ||
find_path(URING_INCLUDE_DIRS liburing.h) | ||
|
||
find_path(URING_INCLUDE_DIR liburing.h) | ||
find_library(URING_LIBRARIES uring) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(uring DEFAULT_MSG URING_LIBRARIES | ||
URING_INCLUDE_DIR) | ||
find_package_handle_standard_args(uring DEFAULT_MSG URING_LIBRARIES URING_INCLUDE_DIRS) | ||
|
||
if(URING_FOUND) | ||
if(NOT TARGET uring) | ||
add_library(uring UNKNOWN IMPORTED) | ||
endif() | ||
set_target_properties( | ||
uring | ||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${URING_INCLUDE_DIR}" | ||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" | ||
IMPORTED_LOCATION "${URING_LIBRARIES}") | ||
mark_as_advanced(URING_LIBRARIES) | ||
endif() | ||
mark_as_advanced(URING_INCLUDE_DIRS URING_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
find_path(ZLIB_INCLUDE_DIRS zlib.h) | ||
|
||
find_library(ZLIB_LIBRARIES z) | ||
|
||
find_package_handle_standard_args(zlib DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Note: Be aware of the differences between CMake project and Makefile project. | ||
|
||
set(actually_built) | ||
|
||
function(build_from_src [dep]) | ||
if (dep STREQUAL "aio") | ||
set(BINARY_DIR ${PROJECT_BINARY_DIR}/aio-build) | ||
ExternalProject_Add( | ||
aio | ||
URL ${PHOTON_AIO_SOURCE} | ||
BUILD_IN_SOURCE ON | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND make prefix=${BINARY_DIR} install -j | ||
INSTALL_COMMAND "" | ||
) | ||
set(AIO_INCLUDE_DIRS ${BINARY_DIR}/include PARENT_SCOPE) | ||
set(AIO_LIBRARIES ${BINARY_DIR}/lib/libaio.a PARENT_SCOPE) | ||
|
||
elseif (dep STREQUAL "zlib") | ||
set(BINARY_DIR ${PROJECT_BINARY_DIR}/zlib-build) | ||
ExternalProject_Add( | ||
zlib | ||
URL ${PHOTON_ZLIB_SOURCE} | ||
BUILD_IN_SOURCE ON | ||
PATCH_COMMAND sed -ie "/CFLAGS.*CFLAGS--O3/ s/}/} -fPIC/" configure | ||
CONFIGURE_COMMAND ./configure --prefix=${BINARY_DIR} --static | ||
BUILD_COMMAND make -j | ||
INSTALL_COMMAND make install | ||
) | ||
set(ZLIB_INCLUDE_DIRS ${BINARY_DIR}/include PARENT_SCOPE) | ||
set(ZLIB_LIBRARIES ${BINARY_DIR}/lib/libz.a PARENT_SCOPE) | ||
|
||
elseif (dep STREQUAL "uring") | ||
set(BINARY_DIR ${PROJECT_BINARY_DIR}/uring-build) | ||
ExternalProject_Add( | ||
uring | ||
GIT_REPOSITORY ${PHOTON_URING_SOURCE} | ||
GIT_TAG liburing-2.3 | ||
GIT_PROGRESS ON | ||
BUILD_IN_SOURCE ON | ||
CONFIGURE_COMMAND ./configure --prefix=${BINARY_DIR} | ||
BUILD_COMMAND make -C src -j | ||
INSTALL_COMMAND make install | ||
) | ||
set(URING_INCLUDE_DIRS ${BINARY_DIR}/include PARENT_SCOPE) | ||
set(URING_LIBRARIES ${BINARY_DIR}/lib/liburing.a PARENT_SCOPE) | ||
|
||
elseif (dep STREQUAL "gflags") | ||
ExternalProject_Add( | ||
gflags | ||
URL ${PHOTON_GFLAGS_SOURCE} | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_POSITION_INDEPENDENT_CODE=ON | ||
INSTALL_COMMAND "" | ||
) | ||
ExternalProject_Get_Property(gflags BINARY_DIR) | ||
set(GFLAGS_INCLUDE_DIRS ${BINARY_DIR}/include PARENT_SCOPE) | ||
set(GFLAGS_LIBRARIES ${BINARY_DIR}/lib/libgflags.a ${BINARY_DIR}/lib/libgflags_nothreads.a PARENT_SCOPE) | ||
|
||
elseif (dep STREQUAL "googletest") | ||
ExternalProject_Add( | ||
googletest | ||
URL ${PHOTON_GOOGLETEST_SOURCE} | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DINSTALL_GTEST=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON | ||
INSTALL_COMMAND "" | ||
) | ||
ExternalProject_Get_Property(googletest SOURCE_DIR) | ||
ExternalProject_Get_Property(googletest BINARY_DIR) | ||
set(GOOGLETEST_INCLUDE_DIRS ${SOURCE_DIR}/googletest/include ${SOURCE_DIR}/googlemock/include PARENT_SCOPE) | ||
set(GOOGLETEST_LIBRARIES ${BINARY_DIR}/lib/libgmock.a ${BINARY_DIR}/lib/libgmock_main.a | ||
${BINARY_DIR}/lib/libgtest.a ${BINARY_DIR}/lib/libgtest_main.a PARENT_SCOPE) | ||
endif () | ||
|
||
list(APPEND actually_built ${dep}) | ||
set(actually_built ${actually_built} PARENT_SCOPE) | ||
endfunction() |
Oops, something went wrong.