Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
236 lines (135 sloc) 5.38 KB

Dependencies

Learn how to get the dependencies your project needs and how to handle their versions via your [requirements] and [includes] sections of your biicode.conf file.

Dependencies

The :ref:`getting started guide<cpp_getting_started>` explained basics on depending. To recall, these are the steps to depend on a library available in biicode, we're using OpenSSL in this guide.

  • Create a new folder and init it:
~$ mkdir deps_example
~$ cd deps_example
~/deps_example$ bii init -L
~/deps_example$ echo "//main.cpp code goes here" >> main.cpp
  • Write your source code as usual in your main.cpp:
  • Search the library you want in biicode, and specify which lib you're using in your biicode.conf file.

/_static/img/c++/dependencies/openssl_md5_simple.png

Let's first use OpenSSL 1.0.1 available in lasote/openssl version 0:

  • Write in your biicode.conf file:

    [requirements]
         lasote/openssl: 0
    
    [includes]
        openssl/md5.h: lasote/openssl/include
    
  • bii build and you're done.

Modifying the version you depend on

Manually edit your biicode.conf file to depend on any version you want.

To depend on lasote/openssl version 2, write in your biicode.conf:

Update your biicode.conf file to depend on lasote/OpenSSL tagged version 1.0.1l:

Run bii build and you'll see the new dependencies in your bii/deps folder.

For OpenSSL, there are two tracks available:

  • OpenSSL 1.0.1 is available at lasote/openssl versions 0,1,2 and 3.
  • OpenSSL 1.0.2 is available at lasote/openssl(v1.0.2) versions 0 and 1.

Update to release 1.0.2, just write it in your biicode.conf:

Execute bii build and you'll see the new dependencies in your bii/deps folder.

Depending on a block track

Currently, libuv keeps four maintained versions or block tracks:

Depend on one or another to fit your needs:

  • Write this #include line in your source code:

  • And depend on Libuv library v0.11, write in your biicode.conf file [requirements] :

  • Execute bii build and you're ready to go.

Let's switch to Libuv library v1.0:

  • Modify [requirements] section in your biicode.conf :

  • Execute bii build and it's switched.

And now, switch to Libuv libary v0.10:

  • Modify [requirements] section in your biicode.conf :

  • bii build and it's switched.

At last, switch to Libuv library v1.x:

  • Modify [requirements] section in your biicode.conf :

  • bii build and it's switched.

Got any doubts? Ask in our forum or write us.