summaryrefslogtreecommitdiff
path: root/indra/cmake/LLWindow.cmake
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2023-04-03 14:58:58 -0700
committerCallum Prentice <callum@lindenlab.com>2023-04-03 14:58:58 -0700
commit28b240fd7fc39ff4668e37b5aa3bdfe392415b34 (patch)
tree923892b5ea9e9ac4d757fba089f0e9b2b24fbf26 /indra/cmake/LLWindow.cmake
parent7b9866791ac7922f7527811bbc99c090f35e4cfd (diff)
parentc7053a6928fd5eafdc935453742e92951ae4e0c1 (diff)
DRTVWR-489: Fix things up after a messy merge with main because of a gigantic CMake patch. Sadly, my macOS box updated to Xcode14.3 overnight and that caused many warnings/errors with variables being initialized and then used but not in a way that affected anything.. Building on Xcode 14.3 also requires that MACOSX_DEPLOYMENT_TARGET be set to > 10.13. Waiting on a decision about that but checking this in in the meantime. Builds on macOS with appropriate build variables set for MACOSX_DEPLOYMENT_TARGET = 10.14 but not really expecting this to build in TC because (REDACTED). Windows version probably hopelessly broken - switching to that now.
Diffstat (limited to 'indra/cmake/LLWindow.cmake')
-rw-r--r--indra/cmake/LLWindow.cmake42
1 files changed, 11 insertions, 31 deletions
diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake
index 80af7ff2ab..b36e970560 100644
--- a/indra/cmake/LLWindow.cmake
+++ b/indra/cmake/LLWindow.cmake
@@ -4,39 +4,19 @@ include(Variables)
include(GLEXT)
include(Prebuilt)
-if (USESYSTEMLIBS)
- include(FindSDL)
+include_guard()
+add_library( ll::SDL INTERFACE IMPORTED )
- # This should be done by FindSDL. Sigh.
- mark_as_advanced(
- SDLMAIN_LIBRARY
- SDL_INCLUDE_DIR
- SDL_LIBRARY
- )
-else (USESYSTEMLIBS)
- if (LINUX)
- use_prebuilt_binary(SDL)
- set (SDL_FOUND TRUE)
- set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
- set (SDL_LIBRARY SDL directfb fusion direct X11)
- endif (LINUX)
-endif (USESYSTEMLIBS)
-if (SDL_FOUND)
- include_directories(${SDL_INCLUDE_DIR})
-endif (SDL_FOUND)
+if (LINUX)
+ #Must come first as use_system_binary can exit this file early
+ target_compile_definitions( ll::SDL INTERFACE LL_SDL=1)
-set(LLWINDOW_INCLUDE_DIRS
- ${GLEXT_INCLUDE_DIR}
- ${LIBS_OPEN_DIR}/llwindow
- )
+ use_system_binary(SDL)
+ use_prebuilt_binary(SDL)
+
+ target_include_directories( ll::SDL SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
+ target_link_libraries( ll::SDL INTERFACE SDL directfb fusion direct X11)
+endif (LINUX)
-if (BUILD_HEADLESS)
- set(LLWINDOW_HEADLESS_LIBRARIES
- llwindowheadless
- )
-endif (BUILD_HEADLESS)
- set(LLWINDOW_LIBRARIES
- llwindow
- )