Permalink
Browse files

Use hidden symbol visibility by default

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 dcb3b2d0b888902a062eefd8200ea194ed1c42d6
Showing with 7 additions and 0 deletions.
  1. +7 −0 CMakeLists.txt
View
@@ -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 )

0 comments on commit dcb3b2d

Please sign in to comment.