mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +00:00
Simplify references in CMake if-statements
Adapted to 3.3-stable from f8d6801a50
.
This commit is contained in:
parent
15b0c43e2d
commit
8270081334
@ -63,7 +63,7 @@ elseif (_GLFW_OSMESA)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (_GLFW_X11 OR _GLFW_WAYLAND)
|
if (_GLFW_X11 OR _GLFW_WAYLAND)
|
||||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h)
|
set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h)
|
||||||
set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c)
|
set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c)
|
||||||
else()
|
else()
|
||||||
@ -73,7 +73,7 @@ if (_GLFW_X11 OR _GLFW_WAYLAND)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Workaround for CMake not knowing about .m files before version 3.16
|
# Workaround for CMake not knowing about .m files before version 3.16
|
||||||
if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE)
|
if (CMAKE_VERSION VERSION_LESS "3.16" AND APPLE)
|
||||||
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)
|
||||||
@ -87,8 +87,8 @@ set_target_properties(glfw PROPERTIES
|
|||||||
POSITION_INDEPENDENT_CODE ON
|
POSITION_INDEPENDENT_CODE ON
|
||||||
FOLDER "GLFW3")
|
FOLDER "GLFW3")
|
||||||
|
|
||||||
if (${CMAKE_VERSION} VERSION_EQUAL "3.1.0" OR
|
if (CMAKE_VERSION VERSION_EQUAL "3.1.0" OR
|
||||||
${CMAKE_VERSION} VERSION_GREATER "3.1.0")
|
CMAKE_VERSION VERSION_GREATER "3.1.0")
|
||||||
|
|
||||||
set_target_properties(glfw PROPERTIES C_STANDARD 99)
|
set_target_properties(glfw PROPERTIES C_STANDARD 99)
|
||||||
else()
|
else()
|
||||||
@ -111,7 +111,7 @@ target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
|
|||||||
|
|
||||||
# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all
|
# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all
|
||||||
# source files that VS will build (Clang ignores this because we set -std=c99)
|
# source files that VS will build (Clang ignores this because we set -std=c99)
|
||||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
set_source_files_properties(context.c init.c input.c monitor.c vulkan.c
|
set_source_files_properties(context.c init.c input.c monitor.c vulkan.c
|
||||||
window.c win32_init.c win32_joystick.c
|
window.c win32_init.c win32_joystick.c
|
||||||
win32_monitor.c win32_time.c win32_thread.c
|
win32_monitor.c win32_time.c win32_thread.c
|
||||||
@ -121,11 +121,11 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable a reasonable set of warnings
|
# Enable a reasonable set of warnings
|
||||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
|
||||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
|
CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
|
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||||
|
|
||||||
if ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
|
if (CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
|
||||||
# Tell Clang-CL that this is a Clang flag
|
# Tell Clang-CL that this is a Clang flag
|
||||||
target_compile_options(glfw PRIVATE "/clang:-Wall")
|
target_compile_options(glfw PRIVATE "/clang:-Wall")
|
||||||
else()
|
else()
|
||||||
|
Loading…
Reference in New Issue
Block a user