From 222c68876fb4c7184b6ba924f67a9f847abafcfa Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Wed, 4 Mar 2015 15:39:21 -0700 Subject: [PATCH] Win/glvdebug: Changes needed to compile glvdebug on Windows. --- tools/glave/src/glv_extensions/glvdebug_xgl/CMakeLists.txt | 5 +++-- tools/glave/src/glvcommon/glv_platform.h | 2 ++ tools/glave/src/glvdebug/glvdebug_qtimelineview.cpp | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/glave/src/glv_extensions/glvdebug_xgl/CMakeLists.txt b/tools/glave/src/glv_extensions/glvdebug_xgl/CMakeLists.txt index 30d6be1..650f8bf 100644 --- a/tools/glave/src/glv_extensions/glvdebug_xgl/CMakeLists.txt +++ b/tools/glave/src/glv_extensions/glvdebug_xgl/CMakeLists.txt @@ -28,8 +28,9 @@ add_custom_command(OUTPUT glvtrace_xgl_packet_id.h glvtrace_xgl_xgl_structs.h gl ${SRC_DIR}/../../../xgl_helper.py) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") -set(OS_REPLAYER_LIBS - ${CMAKE_CURRENT_BINARY_DIR}/../../../../../loader/libXGL.dll + set(PATH_TO_WIN_XGL ${CMAKE_CURRENT_BINARY_DIR}/../../../../../loader/${CMAKE_CFG_INTDIR}) + set(OS_REPLAYER_LIBS + ${PATH_TO_WIN_XGL}/XGL.lib ) endif() diff --git a/tools/glave/src/glvcommon/glv_platform.h b/tools/glave/src/glvcommon/glv_platform.h index 6288074..d4c4139 100644 --- a/tools/glave/src/glvcommon/glv_platform.h +++ b/tools/glave/src/glvcommon/glv_platform.h @@ -52,6 +52,8 @@ typedef pthread_mutex_t GLV_CRITICAL_SECTION; #elif defined(WIN32) #define _CRT_RAND_S #define WIN32_LEAN_AND_MEAN +// The following line is needed to use the C++ std::min() or std::max(): +#define NOMINMAX #include #include #define GLV_WINAPI WINAPI diff --git a/tools/glave/src/glvdebug/glvdebug_qtimelineview.cpp b/tools/glave/src/glvdebug/glvdebug_qtimelineview.cpp index af0d350..23f3bf1 100755 --- a/tools/glave/src/glvdebug/glvdebug_qtimelineview.cpp +++ b/tools/glave/src/glvdebug/glvdebug_qtimelineview.cpp @@ -27,6 +27,10 @@ #include #include #include +#ifdef _WIN32 +// The following line allows Visual Studio to provide the M_PI_2 constant: +#define _USE_MATH_DEFINES +#endif #include #include "glvdebug_qtimelineview.h" #include "glvdebug_QTraceFileModel.h" -- 2.7.4