summaryrefslogtreecommitdiff
path: root/indra/llaudio/CMakeLists.txt
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/llaudio/CMakeLists.txt
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/llaudio/CMakeLists.txt')
-rw-r--r--indra/llaudio/CMakeLists.txt59
1 files changed, 18 insertions, 41 deletions
diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt
index 92a5cfe22f..4f469b9bb5 100644
--- a/indra/llaudio/CMakeLists.txt
+++ b/indra/llaudio/CMakeLists.txt
@@ -7,23 +7,6 @@ include(LLAudio)
include(FMODSTUDIO)
include(OPENAL)
include(LLCommon)
-include(LLMath)
-include(LLMessage)
-include(LLFileSystem)
-
-include_directories(
- ${LLAUDIO_INCLUDE_DIRS}
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLMATH_INCLUDE_DIRS}
- ${LLMESSAGE_INCLUDE_DIRS}
- ${LLFILESYSTEM_INCLUDE_DIRS}
- ${OGG_INCLUDE_DIRS}
- ${VORBISENC_INCLUDE_DIRS}
- ${VORBISFILE_INCLUDE_DIRS}
- ${VORBIS_INCLUDE_DIRS}
- ${OPENAL_LIB_INCLUDE_DIRS}
- ${FREEAULT_LIB_INCLUDE_DIRS}
- )
set(llaudio_SOURCE_FILES
llaudioengine.cpp
@@ -42,10 +25,7 @@ set(llaudio_HEADER_FILES
llwindgen.h
)
-if (FMODSTUDIO)
- include_directories(
- ${FMODSTUDIO_INCLUDE_DIR}
- )
+if (TARGET ll::fmodstudio)
list(APPEND llaudio_SOURCE_FILES
llaudioengine_fmodstudio.cpp
lllistener_fmodstudio.cpp
@@ -57,13 +37,9 @@ if (FMODSTUDIO)
lllistener_fmodstudio.h
llstreamingaudio_fmodstudio.h
)
-endif (FMODSTUDIO)
-
-if (OPENAL)
- include_directories(
- ${OPENAL_LIBRARIES}
- )
+endif ()
+if (TARGET ll::openal)
list(APPEND llaudio_SOURCE_FILES
llaudioengine_openal.cpp
lllistener_openal.cpp
@@ -73,22 +49,23 @@ if (OPENAL)
llaudioengine_openal.h
lllistener_openal.h
)
-endif (OPENAL)
-
-set_source_files_properties(${llaudio_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
+endif ()
list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES})
add_library (llaudio ${llaudio_SOURCE_FILES})
-target_link_libraries(
- llaudio
- ${LLCOMMON_LIBRARIES}
- ${LLMATH_LIBRARIES}
- ${LLMESSAGE_LIBRARIES}
- ${LLFILESYSTEM_LIBRARIES}
- ${VORBISENC_LIBRARIES}
- ${VORBISFILE_LIBRARIES}
- ${VORBIS_LIBRARIES}
- ${OGG_LIBRARIES}
+target_include_directories( llaudio INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries( llaudio
+ llcommon
+ llmath
+ llmessage
+ llfilesystem
+ ll::vorbis
)
+
+if( TARGET ll::openal )
+ target_link_libraries( llaudio ll::openal )
+endif()
+if( TARGET ll::fmodstudio )
+ target_link_libraries( llaudio ll::fmodstudio )
+endif()