build
dxsdk
eglretrace
-glproc.hpp
glretrace
install_manifest.txt
qapitrace
${CMAKE_CURRENT_SOURCE_DIR}/common
)
-add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
- DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/eglapi.py specs/glesapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
-)
-
-# Wrap glproc.hpp as a target to prevent the command from being executed
-# multiple times simulatenously, when the targets that depend on it are built
-# in parallel.
-add_custom_target (glproc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
-
if (WIN32)
set (os os_win32.cpp)
set (glws_os glws_wgl.cpp)
##############################################################################
-# API tracers
+# Sub-directories
+add_subdirectory (dispatch)
add_subdirectory (wrappers)
-
-
-##############################################################################
-# API retracers
-
add_subdirectory (retrace)
--- /dev/null
+glproc.hpp
--- /dev/null
+##############################################################################
+# Dispatch
+
+include_directories (
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ DEPENDS
+ glproc.py
+ dispatch.py
+ ${CMAKE_SOURCE_DIR}/specs/wglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glxapi.py
+ ${CMAKE_SOURCE_DIR}/specs/cglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/eglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glesapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glapi.py
+ ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+)
+
+
+# Wrap glproc.hpp as a target to prevent the command from being executed
+# multiple times simulatenously, when the targets that depend on it are built
+# in parallel.
+add_custom_target (glproc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
+
+
+add_library (glproc_gl STATIC EXCLUDE_FROM_ALL
+ glproc_gl.cpp
+)
+
+add_dependencies (glproc_gl glproc)
+
+set_target_properties (glproc_gl PROPERTIES
+ # Ensure it can be statically linked in shared libraries
+ COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
+)
+
+if (ENABLE_EGL)
+ add_library (glproc_egl STATIC EXCLUDE_FROM_ALL
+ glproc_egl.cpp
+ )
+
+ add_dependencies (glproc_egl glproc)
+
+ set_target_properties (glproc_egl PROPERTIES
+ # Ensure it can be statically linked in shared libraries
+ COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
+ )
+endif ()
+
--- /dev/null
+from dispatch import *
"""
+# Adjust path
+import os.path
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import specs.stdapi as stdapi
"""
-import specs.stdapi as stdapi
from dispatch import Dispatcher
+import specs.stdapi as stdapi
from specs.glapi import glapi
from specs.glxapi import glxapi
from specs.wglapi import wglapi
##############################################################################
# API retracers
-include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+include_directories (
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/dispatch
+)
add_definitions (-DRETRACE)
if (WIN32 OR APPLE OR X11_FOUND)
add_executable (glretrace
${glws_os}
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (glretrace glproc)
target_link_libraries (glretrace
retrace_common
+ glproc_gl
common
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
add_executable (eglretrace
glws_egl_xlib.cpp
- ${CMAKE_SOURCE_DIR}/glproc_egl.cpp
)
add_dependencies (eglretrace glproc)
target_link_libraries (eglretrace
retrace_common
+ glproc_egl
common
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3dretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
DEPENDS
d3dretrace.py
+ dllretrace.py
retrace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d9.py
${CMAKE_SOURCE_DIR}/specs/d3d9types.py
${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
# API tracers
-include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+include_directories (
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/dispatch
+)
if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
DEPENDS
ddrawtrace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d.py
${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
DEPENDS
d3d8trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d8.py
${CMAKE_SOURCE_DIR}/specs/d3d8types.py
${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
DEPENDS
d3d9trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d9.py
${CMAKE_SOURCE_DIR}/specs/d3d9types.py
${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
DEPENDS
d3d10trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
${CMAKE_SOURCE_DIR}/specs/d3d10.py
${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
DEPENDS
d3d10_1trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
${CMAKE_SOURCE_DIR}/specs/d3d10.py
${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
DEPENDS
d3d11trace.py
+ dlltrace.py
trace.py
${CMAKE_SOURCE_DIR}/specs/d3d11.py
${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
wgltrace.py
gltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/wglapi.py
${CMAKE_SOURCE_DIR}/specs/wglenum.py
${CMAKE_SOURCE_DIR}/specs/glapi.py
add_library (wgltrace MODULE opengl32.def
wgltrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (wgltrace glproc)
target_link_libraries (wgltrace
+ glproc_gl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
add_library (cgltrace SHARED
cgltrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (cgltrace glproc)
)
target_link_libraries (cgltrace
+ glproc_gl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
add_library (glxtrace SHARED
glxtrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (glxtrace glproc)
)
target_link_libraries (glxtrace
+ glproc_gl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
add_library (egltrace SHARED
egltrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_egl.cpp
)
add_dependencies (egltrace glproc)
)
target_link_libraries (egltrace
+ glproc_egl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}