From e5a22a7bd89fd353d87bfd302355b1e0fc42c23a Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Thu, 26 Feb 2015 17:01:30 -0700 Subject: [PATCH] Win/glave: Compile/link the glvtrace_xgl64.dll library on Windows. --- glave-generate.py | 4 ++-- .../src/glv_extensions/glvtrace_xgl/CMakeLists.txt | 24 ++++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/glave-generate.py b/glave-generate.py index 1f40af7..0bc21ab 100755 --- a/glave-generate.py +++ b/glave-generate.py @@ -160,7 +160,7 @@ class Subcommand(object): func_protos.append('// Hooked function prototypes\n') for proto in self.protos: if 'Dbg' not in proto.name and 'Wsi' not in proto.name: - func_protos.append('%s;' % proto.c_func(prefix="__HOOKED_xgl", attr="XGLAPI")) + func_protos.append('GLVTRACER_EXPORT %s;' % proto.c_func(prefix="__HOOKED_xgl", attr="XGLAPI")) return "\n".join(func_protos) @@ -169,7 +169,7 @@ class Subcommand(object): func_protos.append('// Hooked function prototypes\n') for proto in self.protos: if func_class in proto.name: - func_protos.append('%s;' % proto.c_func(prefix="__HOOKED_xgl", attr="XGLAPI")) + func_protos.append('GLVTRACER_EXPORT %s;' % proto.c_func(prefix="__HOOKED_xgl", attr="XGLAPI")) return "\n".join(func_protos) diff --git a/tools/glave/src/glv_extensions/glvtrace_xgl/CMakeLists.txt b/tools/glave/src/glv_extensions/glvtrace_xgl/CMakeLists.txt index fdcbf94..999ac9c 100644 --- a/tools/glave/src/glv_extensions/glvtrace_xgl/CMakeLists.txt +++ b/tools/glave/src/glv_extensions/glvtrace_xgl/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 2.8) -# this project is currently only available on Linux -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - project(glvtrace_xgl) include("${SRC_DIR}/build_options.cmake") @@ -64,14 +61,23 @@ target_link_libraries(${PROJECT_NAME} endif() if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") -target_link_libraries(${PROJECT_NAME} - glvcommon - ${CMAKE_CURRENT_BINARY_DIR}/../../../../../loader/libXGL.dll -) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXGL_PROTOTYPES -DXCB_NVIDIA") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DXGL_PROTOTYPES -DXCB_NVIDIA") + set(PATH_TO_WIN_XGL ${CMAKE_CURRENT_BINARY_DIR}/../../../../../loader/${CMAKE_CFG_INTDIR}) + set(PATH_TO_MHOOK ${CMAKE_CURRENT_BINARY_DIR}/../../thirdparty/mhook/mhook-lib/${CMAKE_CFG_INTDIR}) + set(PATH_TO_DISASM ${CMAKE_CURRENT_BINARY_DIR}/../../thirdparty/mhook/disasm-lib/${CMAKE_CFG_INTDIR}) + set(OS_REPLAYER_LIBS + ${PATH_TO_WIN_XGL}/XGL.lib + ${PATH_TO_MHOOK}/mhook.lib + ${PATH_TO_DISASM}/disasm.lib + xcb_nvidia + ) + target_link_libraries(${PROJECT_NAME} + glvcommon + ${OS_REPLAYER_LIBS} + ) endif() build_options_finalize() set_target_properties(glvtrace_xgl PROPERTIES LINKER_LANGUAGE C) - -endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") -- 2.7.4