Skip to content

Commit

Permalink
Fix PORTABLE variable in CMake (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice authored Aug 2, 2023
1 parent 2c5a57a commit 72cc956
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/kvrocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions cmake/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 72cc956

Please sign in to comment.