-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cmake c++17, rocksdb7.10.2, lz4, zstd, liburing
- Loading branch information
Showing
5 changed files
with
167 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (c) 2020-present Baidu, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
INCLUDE(ExternalProject) | ||
|
||
SET(LIBURING_SOURCES_DIR ${THIRD_PARTY_PATH}/liburing) | ||
SET(LIBURING_INSTALL_DIR ${THIRD_PARTY_PATH}/install/liburing) | ||
SET(LIBURING_INCLUDE_DIR "${LIBURING_INSTALL_DIR}/include" CACHE PATH "liburing include directory." FORCE) | ||
SET(LIBURING_LIBRARIES "${LIBURING_INSTALL_DIR}/lib/liburing.a" CACHE FILEPATH "liburing library." FORCE) | ||
|
||
FILE(WRITE ${LIBURING_SOURCES_DIR}/src/build.sh | ||
"make -j${NUM_OF_PROCESSOR}" | ||
) | ||
|
||
ExternalProject_Add( | ||
extern_liburing | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
URL "https://github.com/axboe/liburing/archive/refs/tags/liburing-2.4.tar.gz" | ||
PREFIX ${LIBURING_SOURCES_DIR} | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND mv ../build.sh . COMMAND sh build.sh | ||
INSTALL_COMMAND mkdir -p ${LIBURING_INSTALL_DIR}/lib/ COMMAND cp ${LIBURING_SOURCES_DIR}/src/extern_liburing/src/liburing.a ${LIBURING_LIBRARIES} COMMAND mkdir -p ${LIBURING_INCLUDE_DIR} COMMAND cp -r ${LIBURING_SOURCES_DIR}/src/extern_liburing/src/include/liburing.h ${LIBURING_SOURCES_DIR}/src/extern_liburing/src/include/liburing ${LIBURING_INCLUDE_DIR} | ||
) | ||
|
||
ADD_LIBRARY(liburing STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET liburing PROPERTY IMPORTED_LOCATION ${LIBURING_LIBRARIES}) | ||
ADD_DEPENDENCIES(liburing extern_liburing) |
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,42 @@ | ||
# Copyright (c) 2020-present Baidu, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
INCLUDE(ExternalProject) | ||
|
||
SET(LZ4_SOURCES_DIR ${THIRD_PARTY_PATH}/lz4) | ||
SET(LZ4_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lz4) | ||
SET(LZ4_INCLUDE_DIR "${LZ4_INSTALL_DIR}/include" CACHE PATH "lz4 include directory." FORCE) | ||
SET(LZ4_LIBRARIES "${LZ4_INSTALL_DIR}/lib/liblz4.a" CACHE FILEPATH "lz4 library." FORCE) | ||
|
||
FILE(WRITE ${LZ4_SOURCES_DIR}/src/build.sh | ||
"make -j${NUM_OF_PROCESSOR}" | ||
) | ||
|
||
ExternalProject_Add( | ||
extern_lz4 | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
# GIT_REPOSITORY "https://github.com/google/lz4.git" | ||
# GIT_TAG "apache-lz4-0.17.1" | ||
URL "https://github.com/lz4/lz4/archive/v1.9.4.tar.gz" | ||
PREFIX ${LZ4_SOURCES_DIR} | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND mv ../build.sh . COMMAND sh build.sh | ||
INSTALL_COMMAND mkdir -p ${LZ4_INSTALL_DIR}/lib/ COMMAND cp ${LZ4_SOURCES_DIR}/src/extern_lz4/lib/liblz4.a ${LZ4_LIBRARIES} COMMAND mkdir -p ${LZ4_INCLUDE_DIR} COMMAND cp ${LZ4_SOURCES_DIR}/src/extern_lz4/lib/lz4.h ${LZ4_SOURCES_DIR}/src/extern_lz4/lib/lz4hc.h ${LZ4_INCLUDE_DIR} | ||
) | ||
|
||
ADD_LIBRARY(lz4 STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET lz4 PROPERTY IMPORTED_LOCATION ${LZ4_LIBRARIES}) | ||
ADD_DEPENDENCIES(lz4 extern_lz4) |
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,42 @@ | ||
# Copyright (c) 2020-present Baidu, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
INCLUDE(ExternalProject) | ||
|
||
SET(ZSTD_SOURCES_DIR ${THIRD_PARTY_PATH}/zstd) | ||
SET(ZSTD_INSTALL_DIR ${THIRD_PARTY_PATH}/install/zstd) | ||
SET(ZSTD_INCLUDE_DIR "${ZSTD_INSTALL_DIR}/include" CACHE PATH "zstd include directory." FORCE) | ||
SET(ZSTD_LIBRARIES "${ZSTD_INSTALL_DIR}/lib/libzstd.a" CACHE FILEPATH "zstd library." FORCE) | ||
|
||
FILE(WRITE ${ZSTD_SOURCES_DIR}/src/build.sh | ||
"cd build/cmake && cmake -DZSTD_LEGACY_SUPPORT=5 -DXXH_NAMESPACE=ZSTD_ && make -j${NUM_OF_PROCESSOR}" | ||
) | ||
|
||
ExternalProject_Add( | ||
extern_zstd | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
# GIT_REPOSITORY "https://github.com/google/zstd.git" | ||
# GIT_TAG "apache-zstd-0.17.1" | ||
URL "https://github.com/facebook/zstd/archive/v1.4.4.tar.gz" | ||
PREFIX ${ZSTD_SOURCES_DIR} | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND mv ../build.sh . COMMAND sh build.sh | ||
INSTALL_COMMAND mkdir -p ${ZSTD_INSTALL_DIR}/lib/ COMMAND cp ${ZSTD_SOURCES_DIR}/src/extern_zstd/build/cmake/lib/libzstd.a ${ZSTD_LIBRARIES} COMMAND mkdir -p ${ZSTD_INCLUDE_DIR} COMMAND cp ${ZSTD_SOURCES_DIR}/src/extern_zstd/lib/zstd.h ${ZSTD_SOURCES_DIR}/src/extern_zstd/lib/dictBuilder/zdict.h ${ZSTD_INCLUDE_DIR} | ||
) | ||
|
||
ADD_LIBRARY(zstd STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET zstd PROPERTY IMPORTED_LOCATION ${ZSTD_LIBRARIES}) | ||
ADD_DEPENDENCIES(zstd extern_zstd) |