diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2015-04-21 14:06:30 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-04-21 14:06:30 +0100 |
commit | a49d640573bd2e9d945df80abff8e6a722c19968 (patch) | |
tree | 178fc9174334d1321adc8d6223121b33c2ef2eb5 /wrappers | |
parent | b3ebbef66be45e7bf08db134d1796e6b0833c377 (diff) |
cmake: Check and warn for unexpected egltrace.so symbols too.
Diffstat (limited to 'wrappers')
-rw-r--r-- | wrappers/CMakeLists.txt | 13 | ||||
-rw-r--r-- | wrappers/egltrace-nm.sed | 12 |
2 files changed, 25 insertions, 0 deletions
diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt index 5d5bf6bb..1c03fa7c 100644 --- a/wrappers/CMakeLists.txt +++ b/wrappers/CMakeLists.txt @@ -402,5 +402,18 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE) dl ) + if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID) + # Check and warn if there are unexpected symbols + add_custom_command ( + TARGET egltrace + POST_BUILD + COMMAND + ${CMAKE_NM} --dynamic --defined-only $<TARGET_FILE:egltrace> + | sed -f ${CMAKE_CURRENT_SOURCE_DIR}/egltrace-nm.sed 1>&2 + COMMENT "Checking egltrace.so symbols..." + VERBATIM + ) + endif () + install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) endif () diff --git a/wrappers/egltrace-nm.sed b/wrappers/egltrace-nm.sed new file mode 100644 index 00000000..693f704b --- /dev/null +++ b/wrappers/egltrace-nm.sed @@ -0,0 +1,12 @@ +# Filter-out 'T' symbols +/^[0-9a-fA-F]\+ T /!d +s/^[0-9a-fA-F]\+ T // + +# Filter-out expected symbols +/^_init$/d +/^_fini/d +/^dlopen$/d +/^e\?gl[A-Z][0-9A-Za-z_]\+$/d + +# Warning +s/^/warning: unexpected egltrace.so symbol /p |