This is an automated email from the ASF dual-hosted git repository.
twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 72cc9563 Fix PORTABLE variable in CMake (#1627)
72cc9563 is described below
commit 72cc95634f189350207652db80891ceba7cacd8b
Author: Twice <[email protected]>
AuthorDate: Wed Aug 2 10:19:02 2023 +0800
Fix PORTABLE variable in CMake (#1627)
---
.github/workflows/kvrocks.yaml | 6 +++---
CMakeLists.txt | 8 ++++----
README.md | 2 +-
cmake/rocksdb.cmake | 4 ----
x.py | 4 ----
5 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/kvrocks.yaml b/.github/workflows/kvrocks.yaml
index 3b6edc69..47fd911a 100644
--- a/.github/workflows/kvrocks.yaml
+++ b/.github/workflows/kvrocks.yaml
@@ -111,7 +111,7 @@ jobs:
- name: Darwin Clang without luaJIT
os: macos-11
compiler: auto
- without_luajit: -DUSE_LUAJIT=OFF
+ without_luajit: -DENABLE_LUAJIT=OFF
- name: Ubuntu GCC
os: ubuntu-20.04
compiler: gcc
@@ -160,11 +160,11 @@ jobs:
with_openssl: -DENABLE_OPENSSL=ON
- name: Ubuntu GCC without luaJIT
os: ubuntu-20.04
- without_luajit: -DUSE_LUAJIT=OFF
+ without_luajit: -DENABLE_LUAJIT=OFF
compiler: gcc
- name: Ubuntu Clang without luaJIT
os: ubuntu-20.04
- without_luajit: -DUSE_LUAJIT=OFF
+ without_luajit: -DENABLE_LUAJIT=OFF
compiler: clang
- name: Ubuntu GCC with new encoding
os: ubuntu-20.04
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e7a68a6..d8297e88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,11 +25,11 @@ option(ENABLE_ASAN "enable address sanitizer" OFF)
option(ENABLE_TSAN "enable thread sanitizer" OFF)
option(ASAN_WITH_LSAN "enable leak sanitizer while address sanitizer is
enabled" ON)
option(ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++
instead of shared library" ON)
-option(USE_LUAJIT "use luaJIT instead of lua" ON)
+option(ENABLE_LUAJIT "enable use of luaJIT instead of lua" ON)
option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF)
option(ENABLE_IPO "enable interprocedural optimization" ON)
option(ENABLE_UNWIND "enable libunwind in glog" ON)
-option(PORTABLE "build a portable binary (disable arch-specific
optimizations)" 0)
+set(PORTABLE 0 CACHE STRING "build a portable binary (disable arch-specific
optimizations)")
# TODO: set ENABLE_NEW_ENCODING to ON when we are ready
option(ENABLE_NEW_ENCODING "enable new encoding (#1033) for storing 64bit size
and expire time in milliseconds" OFF)
@@ -132,7 +132,7 @@ include(cmake/libevent.cmake)
include(cmake/fmt.cmake)
include(cmake/jsoncons.cmake)
-if (USE_LUAJIT)
+if (ENABLE_LUAJIT)
include(cmake/luajit.cmake)
else()
include(cmake/lua.cmake)
@@ -148,7 +148,7 @@ list(APPEND EXTERNAL_LIBS lz4)
list(APPEND EXTERNAL_LIBS zstd)
list(APPEND EXTERNAL_LIBS zlib_with_headers)
list(APPEND EXTERNAL_LIBS fmt)
-if (USE_LUAJIT)
+if (ENABLE_LUAJIT)
list(APPEND EXTERNAL_LIBS luajit)
else()
list(APPEND EXTERNAL_LIBS lua)
diff --git a/README.md b/README.md
index 6ce3f9ff..e3348481 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@ $ ./x.py build -DENABLE_OPENSSL=ON
To build with lua instead of luaJIT, run:
```shell
-$ ./x.py build -DUSE_LUAJIT=OFF
+$ ./x.py build -DENABLE_LUAJIT=OFF
```
### Running Kvrocks
diff --git a/cmake/rocksdb.cmake b/cmake/rocksdb.cmake
index e57a12fe..0c9c201e 100644
--- a/cmake/rocksdb.cmake
+++ b/cmake/rocksdb.cmake
@@ -23,10 +23,6 @@ if (DISABLE_JEMALLOC)
set(COMPILE_WITH_JEMALLOC OFF)
endif()
-if (NOT PORTABLE)
- set(PORTABLE 0)
-endif()
-
include(cmake/utils.cmake)
FetchContent_DeclareGitHubWithMirror(rocksdb
diff --git a/x.py b/x.py
index a2490558..4641c983 100755
--- a/x.py
+++ b/x.py
@@ -120,10 +120,6 @@ def build(dir: str, jobs: Optional[int], ghproxy: bool,
ninja: bool, unittest: b
if D:
cmake_options += [f"-D{o}" for o in D]
- portable_flag_enabled = any("DPORTABLE" in o for o in cmake_options)
- if not portable_flag_enabled:
- cmake_options.append("-DPORTABLE=0")
-
run(cmake, str(basedir), *cmake_options, verbose=True, cwd=dir)
if skip_build: