8000 GitHub - kfsone/cmake-symvis: Example of problem symbol visibility in a CMake CXX project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kfsone/cmake-symvis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake Visibility vs Linkage Demo

This is a playground for demonstrating symbol visibility conflicts between libraries in cmake and ways to resolve them, e.g by using PUBLIC/PRIVATE visibility tags on links.

target_link_libraries (mylib yourlib)

defaults to 'PUBLIC', which means any symbols in yourlib will be exposed in the export table of mylib, and also all the compiler properties/flags/include paths/etc.

target_link_libraries (mylib PRIVATE yourlib)

means that I will be a full consumer of yourlib still, but the linker will not expose its symbols upstream.

But can you still see their symbols?

Instructions

Clone the repository and cmake-configure:

cmake -G Ninja -B build -S .
#                        ^- source from this directory (where CMakeLists.txt is),
#               ^- use './build' as the cmake cache/build directory,
#      ^- optionally specify the project generator to use

Attempt to build:

cmake --build build  # assuming you used '-B build',
# cmake --build output  # if you used '-B output' instead, e.g

About

Example of problem symbol visibility in a CMake CXX project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0