Commit 02fc17f5 authored by Wes Tarro's avatar Wes Tarro
Browse files

Fix warnings and CMake issue.

parent 32b2ea52
......@@ -79,6 +79,7 @@ static GLenum GLEWAPIENTRY glewContextInit ()
const GLubyte* s;
GLuint dot;
GLint major, minor;
size_t n;
/* query opengl version */
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString");
......@@ -124,7 +125,6 @@ static GLenum GLEWAPIENTRY glewContextInit ()
GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
}
size_t n;
for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n)
_glewExtensionString[n] = GL_FALSE;
......
......@@ -4,7 +4,7 @@ endif ()
project (glew)
cmake_minimum_required (VERSION 2.4)
cmake_minimum_required (VERSION 2.8.7)
if (COMMAND cmake_policy)
cmake_policy (SET CMP0003 NEW)
......@@ -92,20 +92,20 @@ if (MSVC)
# add options from visual studio project
target_compile_definitions (glew PRIVATE "GLEW_BUILD;VC_EXTRALEAN")
target_compile_definitions (glew_s PRIVATE "GLEW_STATIC;VC_EXTRALEAN")
target_link_libraries (glew PRIVATE -BASE:0x62AA0000)
target_link_libraries (glew LINK_PRIVATE -BASE:0x62AA0000)
# kill security checks which are dependent on stdlib
target_compile_options (glew PRIVATE -GS-)
target_compile_options (glew_s PRIVATE -GS-)
# remove stdlib dependency
target_link_libraries (glew PRIVATE -nodefaultlib -noentry)
target_link_libraries (glew LINK_PRIVATE -nodefaultlib -noentry)
elseif (WIN32 AND ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang")))
# remove stdlib dependency on windows with GCC and Clang (for similar reasons
# as to MSVC - to allow it to be used with any Windows compiler)
target_compile_options (glew PRIVATE -fno-builtin -fno-stack-protector)
target_compile_options (glew_s PRIVATE -fno-builtin -fno-stack-protector)
target_link_libraries (glew PRIVATE -nostdlib)
target_link_libraries (glew LINK_PRIVATE -nostdlib)
endif ()
target_link_libraries (glew PUBLIC ${GLEW_LIBRARIES})
target_link_libraries (glew LINK_PUBLIC ${GLEW_LIBRARIES})
target_link_libraries (glew_s ${GLEW_LIBRARIES})
if(CMAKE_VERSION VERSION_LESS 2.8.12)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment