generated from ENCCS/sphinx-lesson-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consider to use the demo from coderefineary for visibility levels
- Loading branch information
1 parent
dfc8bd6
commit 6578a31
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.. _targets-new-visibility-levels: | ||
|
||
Visibility levels (Code from Coderefineary) | ||
------------------------------------------- | ||
|
||
|
||
Visibility levels ``PRIVATE``, ``PUBLIC``, or ``INTERFACE`` are very powerful and herein we will briefly demonstrate their difference. | ||
|
||
|
||
In this demo, we split the source code into 3 libraries and all files are available in the ``content/code/xx_visibility-levels/`` folder. | ||
|
||
. | ||
├── CMakeLists.txt | ||
├── greeting | ||
│ ├── greeting.cpp | ||
│ └── greeting.hpp | ||
├── hello_world | ||
│ ├── hello_world.cpp | ||
│ └── hello_world.hpp | ||
├── main.cpp | ||
└── world | ||
├── world.cpp | ||
Check failure on line 22 in content/targets-new-visibility-levels.rst GitHub Actions / Build
Check failure on line 22 in content/targets-new-visibility-levels.rst GitHub Actions / Build
|
||
└── world.hpp | ||
|
||
|
||
In this source code, the main function links to greeting which links to hello_world which links to world. | ||
|
||
|
||
.. typealong:: The internal dependency tree | ||
|
||
If you have installed ``Graphviz``, you can visualize the dependencies between these targets: | ||
|
||
.. code-block:: console | ||
$ cd build | ||
$ cmake --graphviz=project.dot .. | ||
$ dot -T svg project.dot -o project.svg | ||
.. figure:: img/project.svg | ||
:align: center | ||
|
||
The dependencies between the four targets in the code example. | ||
|
||
|