On Sun, 2017-01-15 at 12:08 +1100, Craig Scott wrote:
> While not directly answering your question, it seems you may be trying
> to deal with symbol visibility. Are you aware of CMake's symbol
> visibility features? A good place to start would be the
> GenerateExportHeader module, the documentation for which does a
> reasonable job of showing how to use the visibility features CMake
> provides.

Yes, thanks for that info.  My situation is that I need to force ALL
symbols to be private, even those from external static shared libraries
that I'm linking in (whose symbols have global visibility by default).

So I need a linker script that contains (this is for GCC's ld):

  {
      global: ...;
      local: *;
  };

I need the "local: *;" to hide the external symbols, but to keep it from
hiding all my global symbols I need to list them all explicitly in the
global: section.

> Dealing with your question more directly, you may want to look at the
> TARGET form of add_custom_command() and in particular, the PRE_LINK
> keyword. See the Build Events section near the bottom of the page for
> the add_custom_command() docs.

Oh beauty!  That seems to be just what I need.  Thanks!
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to