diff options
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 4 | ||||
-rw-r--r-- | indra/cmake/LLWindow.cmake | 14 | ||||
-rw-r--r-- | indra/cmake/SDL2.cmake | 22 |
4 files changed, 28 insertions, 13 deletions
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 16da388e61..9017fc2fb4 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -52,6 +52,7 @@ set(cmake_SOURCE_FILES Prebuilt.cmake PulseAudio.cmake Python.cmake + SDL2.cmake TemplateCheck.cmake TinyEXR.cmake TinyGLTF.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 1e6dabd6c0..e98c77497b 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -54,6 +54,7 @@ if(WINDOWS) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files openjp2.dll + SDL2.dll ) if(LLCOMMON_LINK_SHARED) @@ -169,6 +170,8 @@ elseif(DARWIN) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files libndofdev.dylib + libSDL2.dylib + libSDL2-2.0.dylib ) if(LLCOMMON_LINK_SHARED) @@ -197,6 +200,7 @@ elseif(LINUX) libortp.so libvivoxoal.so.1 libvivoxsdk.so + libSDL2.so ) set(slvoice_files SLVoice) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 23f4115aeb..b2c1792df1 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -3,18 +3,6 @@ include(Variables) include(GLEXT) include(Prebuilt) +include(SDL2) include_guard() -add_library( ll::SDL INTERFACE IMPORTED ) - - -if (LINUX) - #Must come first as use_system_binary can exit this file early - target_compile_definitions( ll::SDL INTERFACE LL_SDL_VERSION=2 LL_SDL) - - #find_package(SDL2 REQUIRED) - #target_link_libraries( ll::SDL INTERFACE SDL2::SDL2 SDL2::SDL2main X11) - - use_prebuilt_binary(SDL2) - target_link_libraries( ll::SDL INTERFACE SDL2 X11) -endif (LINUX) diff --git a/indra/cmake/SDL2.cmake b/indra/cmake/SDL2.cmake new file mode 100644 index 0000000000..87195ed108 --- /dev/null +++ b/indra/cmake/SDL2.cmake @@ -0,0 +1,22 @@ +# -*- cmake -*- +cmake_minimum_required( VERSION 3.13 FATAL_ERROR ) + +include(Linking) +include( Prebuilt ) +include_guard() + +add_library( ll::SDL2 INTERFACE IMPORTED ) + +use_system_binary( SDL2 ) +use_prebuilt_binary( SDL2 ) + +find_library( SDL2_LIBRARY + NAMES SDL2 + PATHS "${LIBS_PREBUILT_DIR}/lib/release") +if ( "${SDL2_LIBRARY}" STREQUAL "SDL2_LIBRARY-NOTFOUND" ) + message( FATAL_ERROR "unable to find SDL2_LIBRARY" ) +endif() + +target_link_libraries( ll::SDL2 INTERFACE "${SDL2_LIBRARY}" ) +target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include" ) + |