1b8a62b91Sopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd. 2b8a62b91Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3b8a62b91Sopenharmony_ci# you may not use this file except in compliance with the License. 4b8a62b91Sopenharmony_ci# You may obtain a copy of the License at 5b8a62b91Sopenharmony_ci# 6b8a62b91Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7b8a62b91Sopenharmony_ci# 8b8a62b91Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9b8a62b91Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10b8a62b91Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11b8a62b91Sopenharmony_ci# See the License for the specific language governing permissions and 12b8a62b91Sopenharmony_ci# limitations under the License. 13b8a62b91Sopenharmony_ci 14b8a62b91Sopenharmony_ciimport("//build/ohos.gni") 15b8a62b91Sopenharmony_ci 16b8a62b91Sopenharmony_ciohos_cargo_crate("lib") { 17b8a62b91Sopenharmony_ci crate_name = "rustix" 18b8a62b91Sopenharmony_ci crate_type = "rlib" 19b8a62b91Sopenharmony_ci crate_root = "src/lib.rs" 20b8a62b91Sopenharmony_ci 21b8a62b91Sopenharmony_ci sources = [ "src/lib.rs" ] 22b8a62b91Sopenharmony_ci edition = "2018" 23b8a62b91Sopenharmony_ci cargo_pkg_version = "0.36.8" 24b8a62b91Sopenharmony_ci cargo_pkg_authors = "Dan Gohman <dev@sunfishcode.online>, Jakub Konka <kubkon@jakubkonka.com>" 25b8a62b91Sopenharmony_ci cargo_pkg_name = "rustix" 26b8a62b91Sopenharmony_ci cargo_pkg_description = 27b8a62b91Sopenharmony_ci "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls" 28b8a62b91Sopenharmony_ci deps = [ 29b8a62b91Sopenharmony_ci "//third_party/rust/crates/bitflags:lib", 30b8a62b91Sopenharmony_ci "//third_party/rust/crates/io-lifetimes:lib", 31b8a62b91Sopenharmony_ci "//third_party/rust/crates/libc:lib", 32b8a62b91Sopenharmony_ci "//third_party/rust/crates/linux-raw-sys:lib", 33b8a62b91Sopenharmony_ci ] 34b8a62b91Sopenharmony_ci features = [ 35b8a62b91Sopenharmony_ci "io-lifetimes", 36b8a62b91Sopenharmony_ci "libc", 37b8a62b91Sopenharmony_ci "std", 38b8a62b91Sopenharmony_ci "use-libc-auxv", 39b8a62b91Sopenharmony_ci "termios", 40b8a62b91Sopenharmony_ci ] 41b8a62b91Sopenharmony_ci rustenv = [ string_join("", [ "CARGO_CFG_TARGET_OS=linux" ]) ] 42b8a62b91Sopenharmony_ci rustenv += [ string_join("", [ "CARGO_CFG_TARGET_ARCH=x86_64" ]) ] 43b8a62b91Sopenharmony_ci rustenv += [ string_join("", [ "CARGO_CFG_TARGET_POINTER_WIDTH=64" ]) ] 44b8a62b91Sopenharmony_ci rustenv += [ string_join("", [ "CARGO_CFG_TARGET_ENDIAN=little" ]) ] 45b8a62b91Sopenharmony_ci build_root = "build.rs" 46b8a62b91Sopenharmony_ci build_sources = [ "build.rs" ] 47b8a62b91Sopenharmony_ci build_script_outputs = [ "librust_out.rmeta" ] 48b8a62b91Sopenharmony_ci} 49