cmake_minimum_required (VERSION 2.8)
+include (CheckCXXCompilerFlag)
+
project (apitrace)
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
if (WIN32)
# MSVC & MinGW only define & use APIENTRY
add_definitions (-DGLAPIENTRY=__stdcall)
+else (WIN32)
+ CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" CXX_COMPILER_FLAG_VISIBILITY)
+ if (CXX_COMPILER_FLAG_VISIBILITY)
+ add_definitions ("-fvisibility=hidden")
+ endif (CXX_COMPILER_FLAG_VISIBILITY)
endif (WIN32)
if (MSVC)
add_library (glxtrace SHARED glxtrace.cpp trace_write.cpp os_posix.cpp ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
set_target_properties (glxtrace PROPERTIES
+ # avoid the default "lib" prefix
PREFIX ""
)
+ # Prevent symbol relocations internal to our wrapper library to be
+ # overwritten by the application.
+ if (NOT APPLE)
+ set_target_properties (glxtrace PROPERTIES
+ LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
+ )
+ endif (NOT APPLE)
+
target_link_libraries (glxtrace dl)
endif ()
target_link_libraries (glretrace
trace
${OPENGL_gl_LIBRARY}
- ${OPENGL_glu_LIBRARY}
- ${X11_LIBRARIES}
)
if (NOT WIN32)