diff options
author | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2022-02-14 12:26:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 12:26:50 +0300 |
commit | 1fb7beae5e97aadf8471ae7b6e07f5c2e5f33c78 (patch) | |
tree | fc905cdb67494c5b7b59cb21465483f6d0464b31 /subprojects | |
parent | 6df74a76eeacc5240d36fa7e62717cd1cdd238a7 (diff) | |
download | virtual-media-1fb7beae5e97aadf8471ae7b6e07f5c2e5f33c78.tar.xz |
Switch the build system to meson
Due to requirements from community, new projects have to be built with
meson.
To unify with other projects some additional warnings has been enabled,
so appropriate code updates has been implemented.
This commit makes both meson and CMake available to simplyfy transition
in openbmc. CMake support will be removed after switching to meson in
openbmc will be accepted.
Tested:
Compiled and smoke tested.
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Diffstat (limited to 'subprojects')
-rw-r--r-- | subprojects/boost.wrap | 7 | ||||
-rw-r--r-- | subprojects/gtest.wrap | 3 | ||||
-rw-r--r-- | subprojects/nlohmann.wrap | 3 | ||||
-rw-r--r-- | subprojects/packagefiles/boost/meson.build | 44 | ||||
-rw-r--r-- | subprojects/sdbusplus.wrap | 3 |
5 files changed, 60 insertions, 0 deletions
diff --git a/subprojects/boost.wrap b/subprojects/boost.wrap new file mode 100644 index 0000000..71e0382 --- /dev/null +++ b/subprojects/boost.wrap @@ -0,0 +1,7 @@ +[wrap-file] +source_url = https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz +source_hash = 5347464af5b14ac54bb945dc68f1dd7c56f0dad7262816b956138fc53bcc0131 +source_filename = boost_1_77_0.tar.gz + +directory = boost_1_77_0 +patch_directory = boost diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap new file mode 100644 index 0000000..0d37d2e --- /dev/null +++ b/subprojects/gtest.wrap @@ -0,0 +1,3 @@ +[wrap-git] +url = https://github.com/google/googletest +revision = HEAD
\ No newline at end of file diff --git a/subprojects/nlohmann.wrap b/subprojects/nlohmann.wrap new file mode 100644 index 0000000..a77b7c9 --- /dev/null +++ b/subprojects/nlohmann.wrap @@ -0,0 +1,3 @@ +[wrap-git] +revision = b3e5cb7f20dcc5c806e418df34324eca60d17d4e +url = https://github.com/nlohmann/json.git diff --git a/subprojects/packagefiles/boost/meson.build b/subprojects/packagefiles/boost/meson.build new file mode 100644 index 0000000..f991d36 --- /dev/null +++ b/subprojects/packagefiles/boost/meson.build @@ -0,0 +1,44 @@ +project('boost', 'cpp', + version: '1.77', + meson_version: '>=0.56.0') + +cxx = meson.get_compiler('cpp') + +# Build if not available +build_dir = join_paths(meson.current_source_dir(), 'build') +r = run_command('[','!','-d', build_dir, ']') +if r.returncode() == 0 + r = run_command('./bootstrap.sh', '--with-libraries=coroutine,filesystem,iostreams,program_options,regex,system') + assert(r.returncode() == 0, + 'Bootstrap failed' + + '\nstdout: ' + r.stdout().strip() + + '\nstderr: ' + r.stderr().strip()) + + r = run_command('./b2', 'install','--prefix=build') + assert(r.returncode() == 0, + 'b2 failed' + + '\nstdout: ' + r.stdout().strip() + + '\nstderr: ' + r.stderr().strip()) +endif + +include_dir = join_paths('build', 'include') +lib_dir = join_paths(meson.current_source_dir(), 'build', 'lib') + +custom_dep = declare_dependency(link_args: ['-L' + lib_dir, + '-Wl,-rpath-link,' + lib_dir + ]) + +boost_inc = include_directories(include_dir, is_system:true) +boost_dep = declare_dependency( + include_directories : boost_inc, + dependencies : [cxx.find_library('boost_context', dirs: lib_dir, static: true), + cxx.find_library('boost_filesystem', dirs: lib_dir, static: true), + cxx.find_library('boost_regex', dirs: lib_dir, static: true), + cxx.find_library('boost_program_options', dirs: lib_dir, static: true), + cxx.find_library('boost_thread', dirs: lib_dir, static: true), + cxx.find_library('boost_coroutine', dirs: lib_dir, static: true), + cxx.find_library('boost_iostreams', dirs: lib_dir, static: true), + custom_dep + ]) + +meson.override_dependency('boost', boost_dep) diff --git a/subprojects/sdbusplus.wrap b/subprojects/sdbusplus.wrap new file mode 100644 index 0000000..45ffabb --- /dev/null +++ b/subprojects/sdbusplus.wrap @@ -0,0 +1,3 @@ +[wrap-git] +url = https://github.com/openbmc/sdbusplus.git +revision = 95874d930f0bcc8390cd47ab3bb1e5e46db45278 |