MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015556 | CMake | CMake | public | 2015-05-06 06:11 | 2016-02-01 09:10 |
Reporter | Kjell Irgens | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Fedora | OS | Linux | OS Version | 4.0 |
Product Version | CMake 3.2.1 | ||||
Target Version | CMake 3.3 | Fixed in Version | CMake 3.3 | ||
Summary | 0015556: CMAKE_<lang>_VISIBILITY_PRESET not used when compiling static libraries | ||||
Description | When compiling a STATIC library the -fvisibility=hidden compiler flag is not set to gcc when compiling. Why is this a problem? I am linking the resulting static library into another SHARED library, and I want the symbols defined in the link library to be hidden, which is why I used CMAKE_CPP_VISIBILITY_PRESET in the first place. https://gcc.gnu.org/wiki/Visibility [^] "In your build system (Makefile etc), you will probably wish to add the -fvisibility=hidden and -fvisibility-inlines-hidden options to the command line arguments of every GCC invocation" The workaround is to add -fvisibility=HIDDEN as to COMPILE_FLAGS. | ||||
Steps To Reproduce | set (CMAKE_C_VISIBILITY_PRESET hidden) add_library (mplug STATIC test.c) make VERBOSE=1 | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-05-06 06:11 | Kjell Irgens | New Issue | |||
2015-05-06 08:44 | Robert Maynard | Note Added: 0038719 | |||
2015-05-06 10:04 | Kjell Irgens | Note Added: 0038720 | |||
2015-05-06 14:02 | Brad King | Note Added: 0038723 | |||
2015-05-15 04:45 | Kjell Irgens | Note Added: 0038750 | |||
2015-05-26 09:25 | Brad King | Note Added: 0038799 | |||
2015-05-26 09:25 | Brad King | Assigned To | => Brad King | ||
2015-05-26 09:25 | Brad King | Status | new => resolved | ||
2015-05-26 09:25 | Brad King | Resolution | open => fixed | ||
2015-05-26 09:25 | Brad King | Fixed in Version | => CMake 3.3 | ||
2015-05-26 09:25 | Brad King | Target Version | => CMake 3.3 | ||
2016-02-01 09:10 | Robert Maynard | Note Added: 0040402 | |||
2016-02-01 09:10 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|