From 5a112d6cd1cea5df36a75e51931e28c880525c02 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 17 Nov 2010 14:59:27 +0100 Subject: [PATCH] Moved platform identifier define to config header. --- CMakeLists.txt | 11 ++++++++++- src/cocoa/platform.h | 3 --- src/config.h.in | 7 +++++++ src/win32/platform.h | 3 --- src/x11/platform.h | 3 --- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c99d1fc8..5cbdeff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,9 @@ set(common_SOURCES if (WIN32) message(STATUS "Building GLFW for WGL on a Win32 system") + # Define the platform identifier + set(_GLFW_WIN32_WGL 1) + # Set up library and include paths set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND GLFW_INCLUDE_DIR ${OPENGL_INCLUDE_DIR}) @@ -48,7 +51,10 @@ endif (WIN32) #-------------------------------------------------------------------- if (UNIX AND NOT APPLE AND NOT CYGWIN) message(STATUS "Building GLFW for X11 and GLX on a Unix-like system") - + + # Define the platform identifier + set(_GLFW_X11_GLX 1) + # Set up library and include paths set(CMAKE_REQUIRED_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY}) list(APPEND GLFW_INCLUDE_DIR ${X11_X11_INCLUDE_PATH}) @@ -106,6 +112,9 @@ endif(UNIX AND NOT APPLE AND NOT CYGWIN) if (UNIX AND APPLE) message(STATUS "Building GLFW for Cocoa and NSOpenGL on Mac OS X") + # Define the platform identifier + set(_GLFW_COCOA_NSGL 1) + # Universal build, decent set of warning flags... set(CMAKE_OSX_ARCHITECTURES ppc;i386;ppc64;x86_64) set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) diff --git a/src/cocoa/platform.h b/src/cocoa/platform.h index 26f773d5..de41cd1c 100644 --- a/src/cocoa/platform.h +++ b/src/cocoa/platform.h @@ -34,9 +34,6 @@ #include -// This is the Mac OS X version of GLFW -#define _GLFW_MAC_OS_X - #if defined(__OBJC__) #import #else diff --git a/src/config.h.in b/src/config.h.in index b1c77e73..c2c5a942 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -35,6 +35,13 @@ // it. Instead, you should modify the config.h.in file. //======================================================================== +// Define this to 1 if building GLFW for X11/GLX +#cmakedefine _GLFW_X11_GLX +// Define this to 1 if building GLFW for Win32/WGL +#cmakedefine _GLFW_WIN32_WGL +// Define this to 1 if building GLFW for Cocoa/NSOpenGL +#cmakedefine _GLFW_COCOA_NSGL + // Define this to 1 if XRandR is available #cmakedefine _GLFW_HAS_XRANDR 1 // Define this to 1 if Xf86VidMode is available diff --git a/src/win32/platform.h b/src/win32/platform.h index 865bc2df..354eef0e 100644 --- a/src/win32/platform.h +++ b/src/win32/platform.h @@ -32,9 +32,6 @@ #define _platform_h_ -// This is the Windows version of GLFW -#define _GLFW_WIN32 - // We don't need all the fancy stuff #define NOMINMAX #define WIN32_LEAN_AND_MEAN diff --git a/src/x11/platform.h b/src/x11/platform.h index ebd8ec99..09a3afe2 100644 --- a/src/x11/platform.h +++ b/src/x11/platform.h @@ -31,9 +31,6 @@ #ifndef _platform_h_ #define _platform_h_ -// This is the X11 version of GLFW -#define _GLFW_X11 - #include #include #include