Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Add cmake command
Browse files Browse the repository at this point in the history
  • Loading branch information
ooeygui authored Feb 10, 2023
1 parent b8e2af9 commit 08469ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/Porting/SymbolVisibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ Class MY_LIB_PUBLIC example_class {}
MY_LIB_PUBLIC void example_function (){}
```

In your `CMakeLists.txt`, add the following after defining your target to trigger exporting symbols:

`target_compile_definitions(${LIB_NAME} PRIVATE "MY_LIB_BUILDING_LIBRARY")`



## WINDOWS_EXPORT_ALL_SYMBOLS Target Property
CMake implements a macro which will export all symbols on Windows. The `WINDOWS_EXPORT_ALL_SYMBOLS` property causes function symbols to be automatically exported on windows. More detail of how it works can be found in the [WINDOWS_EXPORT_ALL_SYMBOLS CMake Documentation](https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html).

Expand Down

0 comments on commit 08469ab

Please sign in to comment.