From 23021422f3c00f1a07c4d28fcc2a0d2ca15ec66d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 20 Nov 2013 11:49:44 +0100 Subject: [PATCH] Added explicit configuration header macro. --- README.md | 2 ++ src/CMakeLists.txt | 2 ++ src/internal.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ef7d89b..33aa99c3 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ guide in the GLFW documentation. - Added the `GLFW_BUILD_DOCS` CMake option for controlling whether the documentation is built + - Added the `_GLFW_USE_CONFIG_H` configuration macro for controlling whether to + include the configuration header - Renamed configuration header to `glfw_config.h` to avoid conflicts - Bugfix: The `glfw3.pc` file did not respect the `LIB_SUFFIX` CMake option - Bugfix: The `joysticks` test would segfault if a controller had no axes diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8c78ad20..cd699efd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,8 @@ include_directories(${GLFW_SOURCE_DIR}/src ${GLFW_BINARY_DIR}/src ${glfw_INCLUDE_DIRS}) +add_definitions(-D_GLFW_USE_CONFIG_H) + set(common_HEADERS ${GLFW_BINARY_DIR}/src/glfw_config.h internal.h ${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h ${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h) diff --git a/src/internal.h b/src/internal.h index 357277eb..763c150f 100644 --- a/src/internal.h +++ b/src/internal.h @@ -29,7 +29,9 @@ #define _internal_h_ -#include "glfw_config.h" +#if defined(_GLFW_USE_CONFIG_H) + #include "glfw_config.h" +#endif #if defined(_GLFW_USE_OPENGL) // This is the default for glfw3.h