CMakeLists: Set symbol visibility to hidden.
This reduces the size of the final binary by 12% by not including symbols, and thus function bodies that have been inlined for example.
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ find_library(LIBUBSAN NAMES ubsan libubsan.so.0)
|
|||||||
#
|
#
|
||||||
## Set various debug flags (instrumentation libs, coverage, …)
|
## Set various debug flags (instrumentation libs, coverage, …)
|
||||||
#
|
#
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -pedantic -Wall -Wextra -Wconversion")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -pedantic -Wall -Wextra -Wconversion -fvisibility=hidden -fvisibility-inlines-hidden")
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage --coverage")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage --coverage")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user