Browse Source

Apply target visibility on cmake < 3.18 only (#1729)

Co-authored-by: Gleb Mazovetskiy <glex.spb@gmail.com>
pull/1732/head
Epifanov Ivan 5 years ago committed by GitHub
parent
commit
d0d0719e2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CMakeLists.txt

5
CMakeLists.txt

@ -215,7 +215,10 @@ else()
elseif(TARGET SDL2::SDL2-static)
# On some distros, such as vitasdk, only the SDL2::SDL2-static target is available.
# Alias to SDL2::SDL2 because some finder scripts may refer to SDL2::SDL2.
set_target_properties(SDL2::SDL2-static PROPERTIES IMPORTED_GLOBAL TRUE)
if(CMAKE_VERSION VERSION_LESS "3.18")
# Aliasing local targets is not supported on CMake < 3.18, so make it global.
set_target_properties(SDL2::SDL2-static PROPERTIES IMPORTED_GLOBAL TRUE)
endif()
add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
set(SDL2_MAIN SDL2::SDL2main)
else()

Loading…
Cancel
Save