From d6d907f49cdba53f88a29d7f05fbd870a1e5e5e9 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 14 Nov 2010 15:13:04 +0000 Subject: [PATCH] Linux needs the -fvisibility=hidden flags. The font selection of the debugger segmentation faults without it. Since the font is selected when the application begins the debugger is rendered inoperable. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6411 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 7 +++++++ SConstruct | 1 + 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f8b5c9b70..2ff7dbd09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,13 @@ if(VISIBILITY_INLINES_HIDDEN) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden) endif(VISIBILITY_INLINES_HIDDEN) +if(UNIX AND NOT APPLE) + CHECK_CXX_COMPILER_FLAG(-fvisibility=hidden VISIBILITY_HIDDEN) + if(VISIBILITY_HIDDEN) + add_definitions(-fvisibility=hidden) + endif(VISIBILITY_HIDDEN) +endif(UNIX AND NOT APPLE) + if(WIN32) add_definitions(-D_SECURE_SCL=0) add_definitions(-D_CRT_SECURE_NO_WARNINGS) diff --git a/SConstruct b/SConstruct index baf6013105..8a2b8617a3 100644 --- a/SConstruct +++ b/SConstruct @@ -180,6 +180,7 @@ elif sys.platform == 'win32': else: env['CCFLAGS'] += ['-fPIC', '-msse2', '-pthread'] if env['CCVERSION'] >= '4.2.0': + env['CCFLAGS'] += ['-fvisibility=hidden'] env['CXXFLAGS'] += ['-fvisibility-inlines-hidden'] env['CPPDEFINES'] += ['HAVE_CONFIG_H'] env['CPPPATH'].insert(0, '#') # Make sure we pick up our own config.h