mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Make compiler specific workarounds more consistent
This commit is contained in:
parent
e47705d8fb
commit
c1f60ab5dc
@ -100,8 +100,8 @@ target_include_directories(glfw PRIVATE
|
|||||||
${glfw_INCLUDE_DIRS})
|
${glfw_INCLUDE_DIRS})
|
||||||
target_link_libraries(glfw PRIVATE Threads::Threads ${glfw_LIBRARIES})
|
target_link_libraries(glfw PRIVATE Threads::Threads ${glfw_LIBRARIES})
|
||||||
|
|
||||||
|
# Workaround for CMake not knowing about .m files before version 3.16
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# For some reason CMake didn't know about .m until version 3.16
|
|
||||||
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
|
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
|
||||||
cocoa_window.m nsgl_context.m PROPERTIES
|
cocoa_window.m nsgl_context.m PROPERTIES
|
||||||
LANGUAGE C)
|
LANGUAGE C)
|
||||||
@ -146,16 +146,23 @@ if (MINGW)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Workaround for VS deprecating parts of the standard library
|
||||||
|
if (MSVC)
|
||||||
|
target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Workaround for VS 2008 not shipping with stdint.h
|
||||||
|
if (MSVC90)
|
||||||
|
target_include_directories(glfw PUBLIC "${GLFW_SOURCE_DIR}/deps/vs2008")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check for the DirectX 9 SDK as it is not included with VS 2008
|
||||||
if (MSVC90)
|
if (MSVC90)
|
||||||
# Workaround for VS 2008 not shipping with the DirectX 9 SDK
|
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
check_include_file(dinput.h DINPUT_H_FOUND)
|
check_include_file(dinput.h DINPUT_H_FOUND)
|
||||||
if (NOT DINPUT_H_FOUND)
|
if (NOT DINPUT_H_FOUND)
|
||||||
message(FATAL_ERROR "DirectX 9 headers not found; install DirectX 9 SDK")
|
message(FATAL_ERROR "DirectX 9 headers not found; install DirectX 9 SDK")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Workaround for VS 2008 not shipping with stdint.h
|
|
||||||
target_include_directories(glfw PRIVATE "${GLFW_SOURCE_DIR}/deps/vs2008")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
@ -216,10 +223,6 @@ if (BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (GLFW_INSTALL)
|
if (GLFW_INSTALL)
|
||||||
install(TARGETS glfw
|
install(TARGETS glfw
|
||||||
EXPORT glfwTargets
|
EXPORT glfwTargets
|
||||||
|
Loading…
Reference in New Issue
Block a user