summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wrappers/CMakeLists.txt13
-rw-r--r--wrappers/egltrace-nm.sed12
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