Skip to content

Commit

Permalink
Use hidden symbol visibility by default
Browse files Browse the repository at this point in the history
Allows us to hide all the internal symbols from the final binary.
Shaving some 10+% of its size.

v2: use CMAKE_{LANG}_VISIBILITY_PRESET
v3: add CMP0063 guard

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
  • Loading branch information
evelikov committed Sep 4, 2017
1 parent 76d2c2f commit dcb3b2d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ if (WIN32)
endif()
endif()

if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
set(LEX_FLAGS )
set(YACC_FLAGS )
Expand Down

0 comments on commit dcb3b2d

Please sign in to comment.