since Seastar now deprecates a bunch of APIs which accept io_priority_class,
we started to have deprecated warnings. before migrating to V7 API,
let's disable this warning.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
it turns out the only places where we have compiler warnings of
-W-parentheses-equality is the source code generated by ANTLR. strictly
speaking, this is valid C++ code, just not quite readable from the
hygienic point of view. so let's enable this warning in the source tree,
but only disable it when compiling the sources generated by ANTLR.
please note, this warning option is supported by both GCC and Clang,
so no need to test if it is supported.
for a sample of the warnings, see:
```
/home/kefu/dev/scylladb/build/cmake/cql3/CqlLexer.cpp:21752:38: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
if ( (LA4_0 == '$'))
~~~~~~^~~~~~
/home/kefu/dev/scylladb/build/cmake/cql3/CqlLexer.cpp:21752:38: note: remove extraneous parentheses around the comparison to silence this warning
if ( (LA4_0 == '$'))
~ ^ ~
```
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
* transpose include(mode.common) and include (mode.${build_mode}),
so the former can reference the value defined by the latter.
* set stack_usage_threshold for supported build modes.
please note, this compiler option (-Wstack-usage=<bytes>) is only
supported by GCC so far.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
this addresses an oversight in b234c839e4,
which is supposed to mirror the behavior of `configure.py`.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
lld is multi-threaded in some phases, based on observation, it could
spawn up to 16 threads for each link job. and each job could take up
to more than 3 GiB memory in total. without the change, we can run
into OOM with a machine without abundant memory, so increase the
per-link-job mem accordingly.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
change the option name to "LINK_MEM_PER_JOB" as this is not
a Seastar option, but a top-level project option.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
* use the value of disabled_warnings, not the variable name for warning
options, otherwise we'd checking options like `-Wno-disabled_warnings`.
* use different names for the output of check_cxx_compiler_flag() calls.
as the output variable of check_cxx_compiler_flag(..) call is cached,
we cannot reuse it for checking different warning options,
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
turns out we are using static variables to register entries in
global registries, and these variables are not directly referenced,
so linker just drops them when linking the executables or shared
libraries. to address this problem, we just link the whole archive.
another option would be create a linker script or pass
--undefined=<symbol> to linker. neither of them is straightforward.
a helper function is introduced to do this, as we cannot use CMake
3.24 as yet.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
if ANTLR3's header files are not installed into the /usr/include, or
other directories searched by compiler by default. there are chances,
we cannot build the tree. so we have to find it first. as /opt/scylladb
is the directory where `scylla-antlr35-c++-dev` is installed on
debian derivatives, this directory is added so the find package module
can find the header files.
```
In file included from /home/kefu/dev/scylla/db/legacy_schema_migrator.cc:38:
In file included from /home/kefu/dev/scylla/cql3/util.hh:21:
/home/kefu/dev/scylla/build/cmake/cql3/CqlParser.hpp:55:10: fatal error: 'antlr3.hpp' file not found
^~~~~~~~~~~~
```
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
we should find libxcrypt library before using it. in this change,
Findlibxcrypt.cmake is added to find libxcrypt library.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
we should find Thrift library before using it. in this change,
FindThrift.cmake is added to find Thrift library.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
instead of adding `XXH_PRIVATE_API` to compile definitions, link
scylla against xxHash::xxhash, which provides this definition for us.
also move the comment on `XXH_PRIVATE_API` into `FindxxHash.cmake`,
where this definition is added.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
so we can attach compiling definitions in a simpler way.
this change is based on Botond Dénes's change which gives an overhaul
to the existing CMake building system.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
antlr3 generates code like `((foo == bar))`. but Clang does not
like it. let's disable this warning. and explore other options later.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
Scylla uses different build mode to customize the build for different
purposes. in this change, instead of having it in a python dictionary,
the customized settings are located in their own files, and loaded
on demand. we don't support multi-config generator yet.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>