-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is somewhat more modern than the Makefile. Both just invoke cargo under the hood. The proper solution may come when Meson starts supporting external crates: mesonbuild/meson#2173 Right now, this is a just a minimal version for developers. A known issue is modifying dependent crates (rutabaga_gfx) doesn't cause a rebuild. A solution is just `touch src/lib.rs` in ffi. Also, `ninja -C build/ clean` isn't recommended. Just do cargo clean. BUG=344998548 TEST=meson setup build ninja -C build/ install Change-Id: Id5a142cc5cb5a8001198afc4d1cdbe800ec2ec23 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599139 Reviewed-by: Daniel Verkamp <[email protected]> Commit-Queue: Gurchetan Singh <[email protected]>
- Loading branch information
1 parent
642f964
commit 704bec9
Showing
3 changed files
with
54 additions
and
76 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2024 The ChromiumOS Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
project('rutabaga_gfx_ffi', ['rust', 'c'], | ||
version: '0.1.3') | ||
|
||
target_os = host_machine.system() | ||
|
||
# By default cargo would generate rutabaga_gfx_ffi.dll (without the lib | ||
# prefix) for a Windows cdylib | ||
if target_os == 'windows' | ||
shared_lib = 'rutabaga_gfx_ffi.dll' | ||
endif | ||
if target_os == 'darwin' | ||
shared_lib = 'librutabaga_gfx_ffi.dylib' | ||
endif | ||
if target_os == 'linux' | ||
shared_lib = 'librutabaga_gfx_ffi.so' | ||
endif | ||
|
||
cargo = find_program('cargo') | ||
cmd = [cargo, 'build'] | ||
with_gfxstream = get_option('gfxstream') | ||
if with_gfxstream | ||
cmd += '--features=gfxstream' | ||
endif | ||
|
||
rutabaga_gfx_ffi_ct = custom_target( | ||
'rutabaga_gfx_ffi_build', | ||
output: shared_lib, | ||
input: ['src/lib.rs', 'Cargo.toml', 'build.rs'], | ||
command: cmd, | ||
) | ||
|
||
rutabaga_gfx_ffi_h = files('src/include/rutabaga_gfx_ffi.h') | ||
|
||
rutabaga_gfx_ffi = library( | ||
'rutabaga_gfx_ffi', | ||
sources: [rutabaga_gfx_ffi_h, rutabaga_gfx_ffi_ct], | ||
version: '0.1.3', | ||
install: true, | ||
) | ||
|
||
install_headers(rutabaga_gfx_ffi_h, | ||
subdir: 'rutabaga_gfx') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 2024 Android Open Source Project | ||
# SPDX-License-Identifier: MIT | ||
option( | ||
'gfxstream', | ||
type : 'boolean', | ||
value : false, | ||
description : 'Build gfxstream in rutabaga_gfx_ffi', | ||
) |