Giter VIP home page Giter VIP logo

bazel_conan_pkg_config's Introduction

bazel_conan_pkg_config

Bazel repository rule for importing dependencies via conan with its pkg-config generator.

You must have conan and pkg-config installed on your host.

  • Installing conan
  • pkg-config can easily be installed with your system package manager

Usage

Add the following in your WORKSPACE:

http_archive(
    name = "bazel_conan_pkg_config",
    strip_prefix = "bazel_conan_pkg_config-main",
    urls = ["https://github.com/0x2Adr1/bazel_conan_pkg_config/archive/main.zip"],
)

load("@bazel_conan_pkg_config//:conan.bzl", "conan_dep")

# Declare your dependency with the conan_dep() rule
# e.g: Say you want to use openssl 3.0.3 in your project
conan_dep(
    name = "openssl",
    version = "3.0.3",


    # The default is to build from source for conan packages not available in
    # a binary form for your platform, i.e: conan install --build=missing

    # Note: Building a package relies on your host tools, so you will need
    # for instance to have cmake installed if a package is using cmake as
    # its build system and you build it from source

    # You can change this policy if needed with the option below, for example,
    # say you NEVER want to build a dependency from source:
    conan_install_args = [ "--build=never" ],
)

In your BUILD file:

cc_binary(
    name = "my_exe",
    deps = [
        "@openssl//:lib",
    ],
)

Credits

The pkg-config part was made possible thanks to:

bazel_conan_pkg_config's People

Contributors

0x2adr1 avatar wangyihit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.