summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--[-rwxr-xr-x]CMakeLists.txt272
-rw-r--r--wrappers/.gitignore13
-rw-r--r--wrappers/CMakeLists.txt348
-rw-r--r--wrappers/cgltrace.py (renamed from cgltrace.py)2
-rw-r--r--wrappers/d3d10.def (renamed from specs/d3d10.def)0
-rw-r--r--wrappers/d3d10_1.def (renamed from specs/d3d10_1.def)0
-rw-r--r--wrappers/d3d10_1trace.py (renamed from d3d10_1trace.py)2
-rw-r--r--wrappers/d3d10trace.py (renamed from d3d10trace.py)2
-rw-r--r--wrappers/d3d11.def (renamed from specs/d3d11.def)0
-rw-r--r--wrappers/d3d11trace.py (renamed from d3d11trace.py)2
-rw-r--r--wrappers/d3d8.def (renamed from specs/d3d8.def)0
-rw-r--r--wrappers/d3d8trace.py (renamed from d3d8trace.py)2
-rw-r--r--wrappers/d3d9.def (renamed from specs/d3d9.def)0
-rw-r--r--wrappers/d3d9trace.py (renamed from d3d9trace.py)0
-rw-r--r--wrappers/d3dshader.cpp (renamed from d3dshader.cpp)0
-rw-r--r--wrappers/d3dshader.hpp (renamed from d3dshader.hpp)0
-rw-r--r--wrappers/ddraw.def (renamed from specs/ddraw.def)0
-rw-r--r--wrappers/ddrawtrace.py (renamed from ddrawtrace.py)2
-rw-r--r--wrappers/dlltrace.py (renamed from dlltrace.py)2
-rw-r--r--wrappers/egltrace.py (renamed from egltrace.py)4
-rw-r--r--wrappers/glcaps.cpp (renamed from glcaps.cpp)0
-rw-r--r--wrappers/gltrace.hpp (renamed from gltrace.hpp)0
-rw-r--r--wrappers/gltrace.py (renamed from gltrace.py)2
-rw-r--r--wrappers/glxtrace.py (renamed from glxtrace.py)4
-rw-r--r--wrappers/opengl32.def (renamed from specs/opengl32.def)0
-rw-r--r--wrappers/trace.py (renamed from trace.py)6
-rw-r--r--wrappers/wgltrace.py (renamed from wgltrace.py)6
28 files changed, 383 insertions, 294 deletions
diff --git a/.gitignore b/.gitignore
index e16a1f7a..25f71f6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,20 +30,12 @@ CMakeFiles
Makefile
apitrace
build
-cgltrace.cpp
-d3d10trace.cpp
-d3d8trace.cpp
-d3d9trace.cpp
-ddrawtrace.cpp
dxsdk
-egltrace.cpp
eglretrace
glproc.hpp
glretrace
glretrace_gl.cpp
glstate_params.cpp
-glxtrace.cpp
install_manifest.txt
qapitrace
traces
-wgltrace.cpp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c42200e..855d73fc 100755..100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -298,278 +298,8 @@ endif ()
##############################################################################
# API tracers
-if (WIN32)
- if (MINGW)
- # Silence warnings about @nn suffix mismatch
- set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
- endif ()
-
- # ddraw.dll
- if (DirectX_D3D_INCLUDE_DIR)
- include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
- add_custom_command (
- OUTPUT ddrawtrace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
- DEPENDS ddrawtrace.py trace.py specs/d3d.py specs/d3dtypes.py specs/d3dcaps.py specs/ddraw.py specs/winapi.py specs/stdapi.py
- )
- add_library (ddraw MODULE specs/ddraw.def ddrawtrace.cpp)
- target_link_libraries (ddraw
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (ddraw
- PROPERTIES PREFIX ""
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS ddraw LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
- endif ()
-
- # d3d8.dll
- if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
- include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
- add_custom_command (
- OUTPUT d3d8trace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
- DEPENDS d3d8trace.py trace.py specs/d3d8.py specs/d3d8types.py specs/d3d8caps.py specs/winapi.py specs/stdapi.py
- )
- add_library (d3d8 MODULE specs/d3d8.def d3d8trace.cpp d3dshader.cpp)
- target_link_libraries (d3d8
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (d3d8
- PROPERTIES PREFIX ""
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS d3d8 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
- endif ()
-
- # d3d9.dll
- if (DirectX_D3DX9_INCLUDE_DIR)
- include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
- add_custom_command (
- OUTPUT d3d9trace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
- DEPENDS d3d9trace.py trace.py specs/d3d9.py specs/d3d9types.py specs/d3d9caps.py specs/winapi.py specs/stdapi.py
- )
- add_library (d3d9 MODULE specs/d3d9.def d3d9trace.cpp d3dshader.cpp)
- target_link_libraries (d3d9
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (d3d9
- PROPERTIES PREFIX ""
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS d3d9 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
- endif ()
-
- # d3d10.dll
- if (DirectX_D3DX10_INCLUDE_DIR)
- include_directories (SYSTEM ${DirectX_D3DX10_INCLUDE_DIR})
- add_custom_command (
- OUTPUT d3d10trace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
- DEPENDS d3d10trace.py trace.py specs/d3d10misc.py specs/d3d10.py specs/d3d10sdklayers.py specs/d3dcommon.py specs/dxgi.py specs/dxgitype.py specs/dxgiformat.py specs/winapi.py specs/stdapi.py
- )
- add_library (d3d10 MODULE specs/d3d10.def d3d10trace.cpp)
- target_link_libraries (d3d10
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (d3d10
- PROPERTIES PREFIX ""
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS d3d10 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
- endif ()
-
- # d3d10_1.dll
- if (DirectX_D3DX10_INCLUDE_DIR AND DirectX_D3D10_1_INCLUDE_DIR)
- include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
- add_custom_command (
- OUTPUT d3d10_1trace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
- DEPENDS d3d10_1trace.py trace.py specs/d3d10_1.py specs/d3d10.py specs/d3d10sdklayers.py specs/d3dcommon.py specs/dxgi.py specs/dxgitype.py specs/dxgiformat.py specs/winapi.py specs/stdapi.py
- )
- add_library (d3d10_1 MODULE specs/d3d10_1.def d3d10_1trace.cpp)
- target_link_libraries (d3d10_1
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (d3d10_1
- PROPERTIES PREFIX ""
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS d3d10_1 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
- endif ()
-
- # d3d11.dll
- if (DirectX_D3DX11_INCLUDE_DIR)
- include_directories (SYSTEM ${DirectX_D3DX11_INCLUDE_DIR})
- add_custom_command (
- OUTPUT d3d11trace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
- DEPENDS d3d11trace.py trace.py specs/d3d11.py specs/d3d11sdklayers.py specs/d3dcommon.py specs/dxgi.py specs/dxgitype.py specs/dxgiformat.py specs/winapi.py specs/stdapi.py
- )
- add_library (d3d11 MODULE specs/d3d11.def d3d11trace.cpp)
- target_link_libraries (d3d11
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (d3d11
- PROPERTIES PREFIX ""
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS d3d11 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
- endif ()
-
- # opengl32.dll
- add_custom_command (
- OUTPUT wgltrace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
- DEPENDS wgltrace.py gltrace.py trace.py specs/wglapi.py specs/wglenum.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/winapi.py specs/stdapi.py
- )
- add_library (wgltrace MODULE specs/opengl32.def
- wgltrace.cpp
- glcaps.cpp
- glproc_gl.cpp
- )
- add_dependencies (wgltrace glproc)
- target_link_libraries (wgltrace
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- )
- set_target_properties (wgltrace PROPERTIES
- PREFIX ""
- OUTPUT_NAME opengl32
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
- install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
-
-elseif (APPLE)
- # OpenGL framework
- add_custom_command (
- OUTPUT cgltrace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
- DEPENDS cgltrace.py gltrace.py trace.py specs/cglapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
- )
-
- add_library (cgltrace SHARED
- cgltrace.cpp
- glcaps.cpp
- glproc_gl.cpp
- )
-
- add_dependencies (cgltrace glproc)
-
- set_target_properties (cgltrace PROPERTIES
- # OpenGL framework name
- PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
- # Specificy the version and reexport GLU symbols
- LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
-
- target_link_libraries (cgltrace
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- dl
- )
-
- install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
-elseif (X11_FOUND)
- # libGL.so
- add_custom_command (
- OUTPUT glxtrace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
- DEPENDS glxtrace.py gltrace.py trace.py specs/glxapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
- )
-
- add_library (glxtrace SHARED
- glxtrace.cpp
- glcaps.cpp
- glproc_gl.cpp
- )
-
- add_dependencies (glxtrace glproc)
-
- 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.
- LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
-
- target_link_libraries (glxtrace
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- ${X11_X11_LIB}
- ${CMAKE_THREAD_LIBS_INIT}
- dl
- )
-
- install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
-endif ()
-
-
-if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
- # libEGL.so/libGL.so
- add_custom_command (
- OUTPUT egltrace.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
- DEPENDS egltrace.py gltrace.py trace.py specs/eglapi.py specs/glesapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
- )
-
- add_library (egltrace SHARED
- egltrace.cpp
- glcaps.cpp
- glproc_egl.cpp
- )
-
- add_dependencies (egltrace glproc)
-
- set_target_properties (egltrace PROPERTIES
- # avoid the default "lib" prefix
- PREFIX ""
- LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
- # Prevent symbol relocations internal to our wrapper library to be
- # overwritten by the application.
- RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
- )
-
- target_link_libraries (egltrace
- common
- ${ZLIB_LIBRARIES}
- ${SNAPPY_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- dl
- )
+add_subdirectory (wrappers)
- install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
-endif ()
##############################################################################
# API retracers
diff --git a/wrappers/.gitignore b/wrappers/.gitignore
new file mode 100644
index 00000000..8ba6fb81
--- /dev/null
+++ b/wrappers/.gitignore
@@ -0,0 +1,13 @@
+cgltrace.cpp
+d3d10_1trace.cpp
+d3d10trace.cpp
+d3d11trace.cpp
+d3d8trace.cpp
+d3d9trace.cpp
+ddrawtrace.cpp
+dlltrace.cpp
+egltrace.cpp
+gltrace.cpp
+glxtrace.cpp
+trace.cpp
+wgltrace.cpp
diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt
new file mode 100644
index 00000000..d47dc6dd
--- /dev/null
+++ b/wrappers/CMakeLists.txt
@@ -0,0 +1,348 @@
+##############################################################################
+# API tracers
+
+
+include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+
+
+if (WIN32)
+ if (MINGW)
+ # Silence warnings about @nn suffix mismatch
+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
+ endif ()
+
+ # ddraw.dll
+ if (DirectX_D3D_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT ddrawtrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
+ DEPENDS
+ ddrawtrace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d.py
+ ${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
+ ${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
+ ${CMAKE_SOURCE_DIR}/specs/ddraw.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+ add_library (ddraw MODULE ddraw.def ddrawtrace.cpp)
+ target_link_libraries (ddraw
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (ddraw
+ PROPERTIES PREFIX ""
+ )
+ install (TARGETS ddraw LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+ endif ()
+
+ # d3d8.dll
+ if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d8trace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
+ DEPENDS
+ d3d8trace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d8.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d8types.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+ add_library (d3d8 MODULE d3d8.def d3d8trace.cpp d3dshader.cpp)
+ target_link_libraries (d3d8
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (d3d8
+ PROPERTIES PREFIX ""
+ )
+ install (TARGETS d3d8 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+ endif ()
+
+ # d3d9.dll
+ if (DirectX_D3DX9_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d9trace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
+ DEPENDS
+ d3d9trace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d9.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+ add_library (d3d9 MODULE d3d9.def d3d9trace.cpp d3dshader.cpp)
+ target_link_libraries (d3d9
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (d3d9
+ PROPERTIES PREFIX ""
+ )
+ install (TARGETS d3d9 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+ endif ()
+
+ # d3d10.dll
+ if (DirectX_D3DX10_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3DX10_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d10trace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
+ DEPENDS
+ d3d10trace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
+ ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgi.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+ add_library (d3d10 MODULE d3d10.def d3d10trace.cpp)
+ target_link_libraries (d3d10
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (d3d10
+ PROPERTIES PREFIX ""
+ )
+ install (TARGETS d3d10 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+ endif ()
+
+ # d3d10_1.dll
+ if (DirectX_D3DX10_INCLUDE_DIR AND DirectX_D3D10_1_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d10_1trace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
+ DEPENDS
+ d3d10_1trace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
+ ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgi.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+ add_library (d3d10_1 MODULE d3d10_1.def d3d10_1trace.cpp)
+ target_link_libraries (d3d10_1
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (d3d10_1
+ PROPERTIES PREFIX ""
+ )
+ install (TARGETS d3d10_1 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+ endif ()
+
+ # d3d11.dll
+ if (DirectX_D3DX11_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3DX11_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d11trace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
+ DEPENDS
+ d3d11trace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d11.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
+ ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgi.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
+ ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+ add_library (d3d11 MODULE d3d11.def d3d11trace.cpp)
+ target_link_libraries (d3d11
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (d3d11
+ PROPERTIES PREFIX ""
+ )
+ install (TARGETS d3d11 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+ endif ()
+
+ # opengl32.dll
+ add_custom_command (
+ OUTPUT wgltrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
+ DEPENDS
+ wgltrace.py
+ gltrace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/wglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/wglenum.py
+ ${CMAKE_SOURCE_DIR}/specs/glapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glparams.py
+ ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+ ${CMAKE_SOURCE_DIR}/specs/winapi.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.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
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ )
+ set_target_properties (wgltrace PROPERTIES
+ PREFIX ""
+ OUTPUT_NAME opengl32
+ )
+ install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+
+elseif (APPLE)
+ # OpenGL framework
+ add_custom_command (
+ OUTPUT cgltrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
+ DEPENDS
+ cgltrace.py
+ gltrace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/cglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glparams.py
+ ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+
+ add_library (cgltrace SHARED
+ cgltrace.cpp
+ glcaps.cpp
+ ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
+ )
+
+ add_dependencies (cgltrace glproc)
+
+ set_target_properties (cgltrace PROPERTIES
+ # OpenGL framework name
+ PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
+ # Specificy the version and reexport GLU symbols
+ LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
+ )
+
+ target_link_libraries (cgltrace
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ dl
+ )
+
+ install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+elseif (X11_FOUND)
+ # libGL.so
+ add_custom_command (
+ OUTPUT glxtrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
+ DEPENDS
+ glxtrace.py
+ gltrace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/glxapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glparams.py
+ ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+
+ add_library (glxtrace SHARED
+ glxtrace.cpp
+ glcaps.cpp
+ ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
+ )
+
+ add_dependencies (glxtrace glproc)
+
+ 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.
+ LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
+ )
+
+ target_link_libraries (glxtrace
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ ${X11_X11_LIB}
+ ${CMAKE_THREAD_LIBS_INIT}
+ dl
+ )
+
+ install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+endif ()
+
+
+if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
+ # libEGL.so/libGL.so
+ add_custom_command (
+ OUTPUT egltrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
+ DEPENDS
+ egltrace.py
+ gltrace.py
+ trace.py
+ ${CMAKE_SOURCE_DIR}/specs/eglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glesapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glparams.py
+ ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+ )
+
+ add_library (egltrace SHARED
+ egltrace.cpp
+ glcaps.cpp
+ ${CMAKE_SOURCE_DIR}/glproc_egl.cpp
+ )
+
+ add_dependencies (egltrace glproc)
+
+ set_target_properties (egltrace PROPERTIES
+ # avoid the default "lib" prefix
+ PREFIX ""
+ # Prevent symbol relocations internal to our wrapper library to be
+ # overwritten by the application.
+ LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
+ )
+
+ target_link_libraries (egltrace
+ common
+ ${ZLIB_LIBRARIES}
+ ${SNAPPY_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ dl
+ )
+
+ install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+endif ()
diff --git a/cgltrace.py b/wrappers/cgltrace.py
index 0e406635..ea2267cf 100644
--- a/cgltrace.py
+++ b/wrappers/cgltrace.py
@@ -27,10 +27,10 @@
"""Cgl tracing generator."""
+from gltrace import GlTracer
from specs.stdapi import API
from specs.glapi import glapi
from specs.cglapi import cglapi
-from gltrace import GlTracer
class CglTracer(GlTracer):
diff --git a/specs/d3d10.def b/wrappers/d3d10.def
index 5482ab5a..5482ab5a 100644
--- a/specs/d3d10.def
+++ b/wrappers/d3d10.def
diff --git a/specs/d3d10_1.def b/wrappers/d3d10_1.def
index 48bfe146..48bfe146 100644
--- a/specs/d3d10_1.def
+++ b/wrappers/d3d10_1.def
diff --git a/d3d10_1trace.py b/wrappers/d3d10_1trace.py
index 403ac5df..1a4443b0 100644
--- a/d3d10_1trace.py
+++ b/wrappers/d3d10_1trace.py
@@ -24,8 +24,8 @@
##########################################################################/
-from specs.d3d10_1 import d3d10_1
from dlltrace import DllTracer
+from specs.d3d10_1 import d3d10_1
if __name__ == '__main__':
diff --git a/d3d10trace.py b/wrappers/d3d10trace.py
index 527a2f63..1d657697 100644
--- a/d3d10trace.py
+++ b/wrappers/d3d10trace.py
@@ -24,8 +24,8 @@
##########################################################################/
-from specs.d3d10misc import d3d10
from dlltrace import DllTracer
+from specs.d3d10misc import d3d10
if __name__ == '__main__':
diff --git a/specs/d3d11.def b/wrappers/d3d11.def
index 2da8fc21..2da8fc21 100644
--- a/specs/d3d11.def
+++ b/wrappers/d3d11.def
diff --git a/d3d11trace.py b/wrappers/d3d11trace.py
index e40828bf..a4ccd6b2 100644
--- a/d3d11trace.py
+++ b/wrappers/d3d11trace.py
@@ -24,8 +24,8 @@
##########################################################################/
-from specs.d3d11 import d3d11
from dlltrace import DllTracer
+from specs.d3d11 import d3d11
if __name__ == '__main__':
diff --git a/specs/d3d8.def b/wrappers/d3d8.def
index 5134cb8f..5134cb8f 100644
--- a/specs/d3d8.def
+++ b/wrappers/d3d8.def
diff --git a/d3d8trace.py b/wrappers/d3d8trace.py
index af87c2d2..09377cb3 100644
--- a/d3d8trace.py
+++ b/wrappers/d3d8trace.py
@@ -24,8 +24,8 @@
##########################################################################/
-from specs.d3d8 import d3d8
from dlltrace import DllTracer
+from specs.d3d8 import d3d8
class D3D8Tracer(DllTracer):
diff --git a/specs/d3d9.def b/wrappers/d3d9.def
index dbbb0299..dbbb0299 100644
--- a/specs/d3d9.def
+++ b/wrappers/d3d9.def
diff --git a/d3d9trace.py b/wrappers/d3d9trace.py
index 4f40194e..4f40194e 100644
--- a/d3d9trace.py
+++ b/wrappers/d3d9trace.py
diff --git a/d3dshader.cpp b/wrappers/d3dshader.cpp
index a2d5c129..a2d5c129 100644
--- a/d3dshader.cpp
+++ b/wrappers/d3dshader.cpp
diff --git a/d3dshader.hpp b/wrappers/d3dshader.hpp
index 485df056..485df056 100644
--- a/d3dshader.hpp
+++ b/wrappers/d3dshader.hpp
diff --git a/specs/ddraw.def b/wrappers/ddraw.def
index 6186c602..6186c602 100644
--- a/specs/ddraw.def
+++ b/wrappers/ddraw.def
diff --git a/ddrawtrace.py b/wrappers/ddrawtrace.py
index 44d0f6fe..e640f40a 100644
--- a/ddrawtrace.py
+++ b/wrappers/ddrawtrace.py
@@ -24,8 +24,8 @@
##########################################################################/
-from specs.d3d import ddraw, interfaces
from dlltrace import DllTracer
+from specs.d3d import ddraw, interfaces
class DDrawTracer(DllTracer):
diff --git a/dlltrace.py b/wrappers/dlltrace.py
index 647b238d..3912dd07 100644
--- a/dlltrace.py
+++ b/wrappers/dlltrace.py
@@ -26,8 +26,8 @@
"""Trace code generation for Windows DLLs."""
-from dispatch import Dispatcher
from trace import Tracer
+from dispatch import Dispatcher
class DllTracer(Tracer):
diff --git a/egltrace.py b/wrappers/egltrace.py
index 5d5c7593..65c14efd 100644
--- a/egltrace.py
+++ b/wrappers/egltrace.py
@@ -32,12 +32,12 @@
"""EGL tracing generator."""
+from gltrace import GlTracer
+from dispatch import function_pointer_type, function_pointer_value
from specs.stdapi import API
from specs.glapi import glapi
from specs.eglapi import eglapi
from specs.glesapi import glesapi
-from gltrace import GlTracer
-from dispatch import function_pointer_type, function_pointer_value
class EglTracer(GlTracer):
diff --git a/glcaps.cpp b/wrappers/glcaps.cpp
index f6f70f32..f6f70f32 100644
--- a/glcaps.cpp
+++ b/wrappers/glcaps.cpp
diff --git a/gltrace.hpp b/wrappers/gltrace.hpp
index e4fefc3d..e4fefc3d 100644
--- a/gltrace.hpp
+++ b/wrappers/gltrace.hpp
diff --git a/gltrace.py b/wrappers/gltrace.py
index 6fc456c8..128568ff 100644
--- a/gltrace.py
+++ b/wrappers/gltrace.py
@@ -27,11 +27,11 @@
"""GL tracing generator."""
+from trace import Tracer
import specs.stdapi as stdapi
import specs.glapi as glapi
import specs.glparams as glparams
from specs.glxapi import glxapi
-from trace import Tracer
class TypeGetter(stdapi.Visitor):
diff --git a/glxtrace.py b/wrappers/glxtrace.py
index b8dac389..8c18e0bd 100644
--- a/glxtrace.py
+++ b/wrappers/glxtrace.py
@@ -28,11 +28,11 @@
"""GLX tracing generator."""
+from gltrace import GlTracer
+from dispatch import function_pointer_type, function_pointer_value
from specs.stdapi import API
from specs.glapi import glapi
from specs.glxapi import glxapi
-from gltrace import GlTracer
-from dispatch import function_pointer_type, function_pointer_value
class GlxTracer(GlTracer):
diff --git a/specs/opengl32.def b/wrappers/opengl32.def
index 9e717a79..9e717a79 100644
--- a/specs/opengl32.def
+++ b/wrappers/opengl32.def
diff --git a/trace.py b/wrappers/trace.py
index 4d6d9745..e2e11ec3 100644
--- a/trace.py
+++ b/wrappers/trace.py
@@ -26,6 +26,12 @@
"""Common trace code generation."""
+# Adjust path
+import os.path
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import specs.stdapi as stdapi
diff --git a/wgltrace.py b/wrappers/wgltrace.py
index 4dfd0f4e..22db6f06 100644
--- a/wgltrace.py
+++ b/wrappers/wgltrace.py
@@ -27,12 +27,12 @@
"""WGL tracing code generator."""
+from gltrace import GlTracer
+from dispatch import function_pointer_type, function_pointer_value
+from codegen import *
from specs.stdapi import API
from specs.glapi import glapi
from specs.wglapi import wglapi
-from dispatch import function_pointer_type, function_pointer_value
-from gltrace import GlTracer
-from codegen import *
class WglTracer(GlTracer):