Skip to content

OPENSSL_STATIC ignored if pkg-config succeeds #878

Closed
@harmic

Description

@harmic

In a system with pkg-config working, if you give this:

OPENSSL_STATIC=1 cargo build

then OPENSSL_STATIC is ignored. The reason is that build.rs calls try_pkg_config before it even considers OPENSSL_STATIC, and if try_pkg_config succeeds it exits build.rs early.

The workaround is to set both OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR manually so that try_pkg_config is never invoked. The documentation does not state this as a requirement though.

See also: how-do-i-statically-link-the-openssl-sys-crate-into-a-shared-library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions