Skip to content

Commit

Permalink
CMake: hide all the symbols by default
Browse files Browse the repository at this point in the history
Hide all the symbols that are not explicitly exported with YAML_CPP_API.
This way the ABI will be way smaller, and only actually exposing the
public classes/functions.
  • Loading branch information
pinotree committed Sep 25, 2021
1 parent 762e6f6 commit 5fe6157
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ include(GNUInstallDirs)
include(CTest)
include(GenerateExportHeader)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format)

option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON)
Expand Down

0 comments on commit 5fe6157

Please sign in to comment.