Remove legacy MacOS conditions
@@ -231,11 +231,6 @@ if(NOT SDL2_BUILDING_LIBRARY)
endif()
endif()
-# SDL2 may require threads on your system.
-# The Apple build may not need an explicit flag because one of the
-# frameworks may already provide it.
-# But for non-OSX systems, I will use the CMake Threads package.
-if(NOT APPLE)
find_package(Threads QUIET)
if(NOT Threads_FOUND)
set(SDL2_THREADS_NOT_FOUND "Could NOT find Threads (Threads is required by SDL2).")
@@ -249,7 +244,6 @@ if(NOT APPLE)
endif()
unset(SDL2_THREADS_NOT_FOUND)
endif()
-endif()
# MinGW needs an additional link flag, -mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
@@ -267,22 +261,8 @@ if(SDL2_LIBRARY)
unset(_SDL2_MAIN_INDEX)
endif()
- # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
- # CMake doesn't display the -framework Cocoa string in the UI even
- # though it actually is there if I modify a pre-used variable.
- # I think it has something to do with the CACHE STRING.
- # So I use a temporary variable until the end so I can set the
- # "real" variable in one-shot.
- if(APPLE)
- set(SDL2_LIBRARIES ${SDL2_LIBRARIES} -framework Cocoa)
- endif()
- # For threads, as mentioned Apple doesn't need this.
- # In fact, there seems to be a problem if I used the Threads package
- # and try using this line, so I'm just skipping it entirely for OS X.
- if(NOT APPLE)
set(SDL2_LIBRARIES ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
- endif()
# For MinGW library
if(MINGW)
@@ -339,18 +319,11 @@ if(SDL2_FOUND)
IMPORTED_LOCATION "${SDL2_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}")
- if(APPLE)
- # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
- # For more details, please see above.
- set_property(TARGET SDL2::Core APPEND PROPERTY
- INTERFACE_LINK_OPTIONS -framework Cocoa)
- else()
# For threads, as mentioned Apple doesn't need this.
# For more details, please see above.
set_property(TARGET SDL2::Core APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Threads::Threads)
endif()
- endif()
# SDL2::Main target
# Applications should link to SDL2::Main instead of SDL2::Core
