1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-26 20:28:49 -05:00

MinGW flag logic cleanup.

This commit is contained in:
Camilla Berglund 2015-05-11 23:51:48 +02:00
parent 35b6c72634
commit 6af25fb423

View File

@ -138,7 +138,6 @@ endif()
if (MINGW) if (MINGW)
# Enable link-time exploit mitigation features enabled by default on MSVC # Enable link-time exploit mitigation features enabled by default on MSVC
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
# Compatibility with data execution prevention (DEP) # Compatibility with data execution prevention (DEP)
@ -161,6 +160,12 @@ if (MINGW)
if (_GLFW_HAS_64ASLR) if (_GLFW_HAS_64ASLR)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}") set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
endif() endif()
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
# the inclusion of stddef.h (by glfw3.h), which is itself included before
# win32_platform.h. We define them here until a saner solution can be found
# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
add_definitions(-DUNICODE -DWINVER=0x0501)
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -218,14 +223,6 @@ if (_GLFW_WIN32)
if (GLFW_USE_OPTIMUS_HPG) if (GLFW_USE_OPTIMUS_HPG)
set(_GLFW_USE_OPTIMUS_HPG 1) set(_GLFW_USE_OPTIMUS_HPG 1)
endif() endif()
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
# the inclusion of stddef.h (by glfw3.h), which is itself included before
# win32_platform.h. We define them here until a saner solution can be found
# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_definitions(-DUNICODE -DWINVER=0x0501)
endif()
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------