build: early check user on libclang.so due to bindgen

This commit is contained in:
Matteo Settenvini 2025-02-22 00:35:01 +01:00
parent be565d948b
commit a521428ea2
5 changed files with 16 additions and 5 deletions

View File

@ -34,7 +34,7 @@ repos:
hooks: hooks:
- id: commitizen - id: commitizen
- id: commitizen-branch - id: commitizen-branch
stages: [push] stages: [pre-push]
- repo: local - repo: local
hooks: hooks:

View File

@ -33,6 +33,15 @@ setup_crates(${CMAKE_CURRENT_SOURCE_DIR})
# ------------------------------- # -------------------------------
# Install Rust libraries or binaries # Install Rust libraries or binaries
# libclang is required for bindgen, just check here
# for an early failure
unset(libclang_names)
foreach(clang_ver RANGE 9 100)
list(PREPEND libclang_names "clang-${clang_ver}")
endforeach()
list(REVERSE libclang_names)
find_library(LIBCLANG NAMES clang ${libclang_names} REQUIRED)
set(libname "libnss_parental_ctrls.so") set(libname "libnss_parental_ctrls.so")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnss_parental_ctrls.so install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnss_parental_ctrls.so
TYPE LIB TYPE LIB

View File

@ -9,6 +9,10 @@ version = "0.1.0"
edition = "2024" edition = "2024"
license = "EUPL-1.2" license = "EUPL-1.2"
readme = "README.md" readme = "README.md"
rust-version = "1.85"
[profile.release]
panic = "unwind" # We rely on this for the NSS module
[workspace] [workspace]
members = ["crates/nss"] members = ["crates/nss"]

View File

@ -11,15 +11,13 @@ version = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
homepage = { workspace = true } homepage = { workspace = true }
repository = { workspace = true } repository = { workspace = true }
rust-version = { workspace = true }
[lib] [lib]
name = "nss_parental_ctrls" name = "nss_parental_ctrls"
path = "src/lib.rs" path = "src/lib.rs"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[profile.release]
panic = "unwind" # We rely on this
[build-dependencies] [build-dependencies]
bindgen = { workspace = true } bindgen = { workspace = true }

View File

@ -2,6 +2,6 @@
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
[toolchain] [toolchain]
channel = "1.85" channel = "stable"
profile = "default" profile = "default"
components = ["rustfmt"] components = ["rustfmt"]