mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +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()
|
||||
|
||||
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_SOURCES ${glfw_SOURCES} linux_joystick.c)
|
||||
else()
|
||||
@ -73,7 +73,7 @@ if (_GLFW_X11 OR _GLFW_WAYLAND)
|
||||
endif()
|
||||
|
||||
# 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
|
||||
cocoa_window.m nsgl_context.m PROPERTIES
|
||||
LANGUAGE C)
|
||||
@ -87,8 +87,8 @@ set_target_properties(glfw PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
FOLDER "GLFW3")
|
||||
|
||||
if (${CMAKE_VERSION} VERSION_EQUAL "3.1.0" OR
|
||||
${CMAKE_VERSION} VERSION_GREATER "3.1.0")
|
||||
if (CMAKE_VERSION VERSION_EQUAL "3.1.0" OR
|
||||
CMAKE_VERSION VERSION_GREATER "3.1.0")
|
||||
|
||||
set_target_properties(glfw PROPERTIES C_STANDARD 99)
|
||||
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
|
||||
# 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
|
||||
window.c win32_init.c win32_joystick.c
|
||||
win32_monitor.c win32_time.c win32_thread.c
|
||||
@ -121,11 +121,11 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
endif()
|
||||
|
||||
# Enable a reasonable set of warnings
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
|
||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
|
||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||
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
|
||||
target_compile_options(glfw PRIVATE "/clang:-Wall")
|
||||
else()
|
||||
|
Loading…
Reference in New Issue
Block a user