Hello,
2008/8/2 Leopold Palomo Avellaneda <[EMAIL PROTECTED]>:
> A Dissabte 02 Agost 2008, Hendrik Sattler va escriure:
>> Am Samstag, 2. August 2008 01:21:01 schrieb Leopold Palomo Avellaneda:
>> > > [...]
>> > > BTW: With gcc >= 4 on linux, you may also want to use
>> > > #define MYLIB_EXPORT __attribute__((visibility("default")))
>> > > and compile with -fvisibility=hidden. That allows to not export symbols
>> > > for internal classes and it's faster at runtime.
>> >
>> > faster in terms of?
>>
>> Time to link the library at application start.
>
> because when the program loads, search in a list of less symbols, so it finds
> its faster making start is less time ....
If you also have to support older gcc based compilers, you can write a
linker map,
that truns all symbols into local symbols and the symbols that should
be externally
visible can "stay" global.
mylib.map
{
global:
FunctionX;
FunctionY;
local:
*;
}
Then in CMake:
SET_TARGET_PROPERTIES(MyLib PROPERTIES
"-Wl,--version-script=${MyLib_SOURCE_DIR}/mylib.map -Wl,--strip-all")
Then stripping the library should remove all unnecessary symbols. Note
that you have to invest some time maintaining the symbols, and that you
probably have to mangle the C++ symbols properly. (You could do that
with "for x in ${PUBLIC_CLASSES} ; do nm libMyLib.so | grep ${x} ; done")
kind regards
Andreas Pokorny
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake