Skip to content

Commit 5bd72e8

Browse files
committed
crates: add phper-build.
1 parent c858655 commit 5bd72e8

File tree

8 files changed

+48
-1
lines changed

8 files changed

+48
-1
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
members = [
33
"phper",
44
"phper-alloc",
5+
"phper-build",
56
"phper-macros",
67
"phper-sys",
78

phper-build/Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "phper-build"
3+
version = "0.2.0"
4+
authors = ["jmjoy <[email protected]>"]
5+
edition = "2018"
6+
description = "Generates stubs for project using phper."
7+
repository = "https://github.com/jmjoy/phper.git"
8+
license = "Unlicense"
9+
keywords = ["php", "binding"]
10+
11+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
12+
13+
[dependencies]
14+
phper-sys = { version = "0.2", path = "../phper-sys" }

phper-build/LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

phper-build/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# phper-build
2+
3+
Generates stubs for project using phper.

phper-build/src/lib.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use phper_sys::{
2+
USING_ZTS,
3+
PHP_DEBUG,
4+
PHP_MAJOR_VERSION,
5+
PHP_MINOR_VERSION,
6+
};
7+
8+
/// Register useful rust cfg for project using phper.
9+
pub fn register_configures() {
10+
register_versions();
11+
12+
if PHP_DEBUG > 0 {
13+
println!("cargo:rustc-cfg=phper_debug");
14+
}
15+
if USING_ZTS > 0 {
16+
println!("cargo:rustc-cfg=phper_zts");
17+
}
18+
}
19+
20+
fn register_versions() {
21+
}

phper/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ keywords = ["php", "binding", "extension"]
1212
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1313

1414
[dependencies]
15-
#derive_builder = "0.9.0"
1615
phper-alloc = { version = "0.2", path = "../phper-alloc" }
1716
phper-macros = { version = "0.2", path = "../phper-macros" }
1817
phper-sys = { version = "0.2", path = "../phper-sys" }
1918
thiserror = "1.0.10"
19+
20+
[build-dependencies]
21+
phper-build = { version = "0.2", path = "../phper-build" }
22+
phper-sys = { version = "0.2", path = "../phper-sys" }

phper/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
phper_build::register_configures();
3+
}

phper/src/function.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::sys::{
22
zend_execute_data, zend_function_entry, zend_internal_arg_info, zval,
33
};
4+
use crate::{c_str, c_str_ptr};
45

56
use std::ffi::{c_void, CStr};
67

0 commit comments

Comments
 (0)