kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #26061
CMake visibility options question
-
To:
Kicad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Tomasz Wlostowski <tomasz.wlostowski@xxxxxxx>
-
Date:
Tue, 6 Sep 2016 19:33:03 +0200
-
Authentication-results:
spf=pass (sender IP is 188.184.36.48) smtp.mailfrom=cern.ch; lists.launchpad.net; dkim=none (message not signed) header.d=none;lists.launchpad.net; dmarc=bestguesspass action=none header.from=cern.ch;
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:99
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
Hi,
I'm trying to build the kiface DLLs with all symbols exported so that I
could link them to external test programs (e.g. P&S test cases).
AFAIK symbol visibility is normally controlled in CMake by through the
CMAKE_CXX_VISIBILITY_PRESET variable. However, the following code in the
CMakeLists.txt file forces the symbol visibility to hidden:
-- snip --
if( POLICY CMP0063 )
cmake_policy( GET CMP0063 VISIBILITY_POLICY )
if( VISIBILITY_POLICY STREQUAL NEW )
message( WARNING "Compatibility code for CMake < 3.3 can be
removed, search for CMP0063" )
else()
cmake_policy( SET CMP0063 NEW )
endif()
else()
if( CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY AND NOT APPLE )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY}hidden" )
endif()
if( CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN AND NOT APPLE )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}" )
endif()
endif()
-- snip --
Could anybody explain what is this code for and if it's really needed
(or maybe it's buggy)?
As a side comment, is there any practical reason to link with
-fvisibility=hidden (maybe except the stable releases)?
Cheers,
Tom
Follow ups