Commit Graph

13 Commits

Author SHA1 Message Date
Kefu Chai
0b5a861961 build: cmake: reference build_mode with ${scylla_build_mode_${CMAKE_BUILD_TYPE}}
before this change, if we generate the building system with plain
`Ninja`, instead of `Ninja Multi-Config` using cmake, the build
fails, because `${scylla_build_mode_${CMAKE_BUILD_TYPE}}` is not
defined. so the profile used for building the rust library would be
"rust-", which does not match any of the profiles defined by
`Cargo.toml`.

in this change, we use `$CMAKE_BUILD_TYPE` instead of "$config". as
the former is defined for non-multi generator. while the latter
is. see https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html

with this change, we are able to generate the building system properly
with the "Ninja" generator. if we just want to run some static analyzer
against the source tree or just want to build scylladb with a single
configuration, the "Ninja" generator is a good fit.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#18353
2024-04-25 10:51:54 +03:00
Kefu Chai
51a789afc1 build: cmake: use scylla build mode for rust profile name
before this change, we used the lower-case CMake build configuration
name for the rust profile names. but this was wrong, because the
profiles are named with the scylla build mode.

in this change, we translate the $<CONFIG> to scylla build mode,
and use it for the profile name and for the output directory of
the built library.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-06 15:53:11 +08:00
Kefu Chai
f2693752f1 build: cmake: avoid referencing CMAKE_BUILD_TYPE
use generator-expresion instead, so that the value can be evaluated
when generating the build system. this prepares for the multi-config
support.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15942
2023-11-06 10:34:38 +02:00
Kefu Chai
ece45c9f70 build: cmake: use find_program(.. REQUIRED) when appropriate
instead of checking the availability of a required program, let's
use the `REQUIRED` argument introduced by CMake 3.18, simpler this
way.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15447
2023-09-18 16:35:46 +03:00
Kefu Chai
9e562f8707 build: cmake s/FATAL/FATAL_ERROR/
we should have used "FATAL_ERROR" instead of "FATAL", as the first
parameter passed to the "message()" command. see
https://cmake.org/cmake/help/v3.0/command/message.html

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #14124
2023-06-06 10:53:32 +03:00
Kefu Chai
dceb364c5c build: cmake: include cxx.h with relative path
before this change, the wasm binding source files includes the
cxxbridge header file of `cxx.h` with its full path.
to better mirror the behavior of configure.py, let's just
include this header file with relative path.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-04-04 15:33:20 +08:00
Kefu Chai
4505b0a9ca build: cmake: add more tests
* test/boost: add more tests: all tests listed in test/boost/CMakeLists.txt
  should build now.
* rust: add inc library, which is used for testing.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-03-15 15:38:47 +08:00
Kefu Chai
167d018ca7 build: cmake: expose scylla_gen_build_dir
should have exposed the base directory of genereted headers, not
the one with "rust" component.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-03-02 10:15:25 +08:00
Kefu Chai
a2668f8ba8 build: cmake: output rust binding headers in expected dir
we include rust binding headers like `rust/wasmtime_bindings.hh`.
so they should be located in directory named "rust".

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-02-19 12:46:51 +08:00
Kefu Chai
f5750859f7 build: cmake: expose the bridged rust library
so that scylla can be linked against it when it is linked with
wasmtime_bindings.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-02-17 18:39:44 +08:00
Kefu Chai
7569424d86 build: cmake: correct library path
it encodes the profile in it. so, in this change, the used profile
is added in the path.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-02-17 18:39:44 +08:00
Kefu Chai
c0824c6c25 build: cmake: put generated sources into ${scylla_gen_build_dir}
to be aligned with the convention of configure.py

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-02-17 18:38:44 +08:00
Kefu Chai
95f8b4eab1 build: cmake: add rust binding
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-02-14 23:54:20 +08:00