Merge pull request #6172 from degasus/cmake_opus
externals: Search for shared opus installation.
This commit is contained in:
		@@ -172,6 +172,8 @@ macro(yuzu_find_packages)
 | 
			
		||||
        "nlohmann_json     3.8         nlohmann_json/3.8.0"
 | 
			
		||||
        "ZLIB              1.2         zlib/1.2.11"
 | 
			
		||||
        "zstd              1.4         zstd/1.4.8"
 | 
			
		||||
    # can't use opus until AVX check is fixed: https://github.com/yuzu-emu/yuzu/pull/4068
 | 
			
		||||
        #"opus              1.3         opus/1.3.1"
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    foreach(PACKAGE ${REQUIRED_LIBS})
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								externals/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								externals/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							@@ -97,4 +97,8 @@ if (ENABLE_WEB_SERVICE)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Opus
 | 
			
		||||
add_subdirectory(opus)
 | 
			
		||||
find_package(opus 1.3)
 | 
			
		||||
if (NOT opus_FOUND)
 | 
			
		||||
    message(STATUS "opus 1.3 or newer not found, falling back to externals")
 | 
			
		||||
    add_subdirectory(opus EXCLUDE_FROM_ALL)
 | 
			
		||||
endif()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								externals/find-modules/Findopus.cmake
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								externals/find-modules/Findopus.cmake
									
									
									
									
										vendored
									
									
								
							@@ -28,7 +28,7 @@ if(opus_FOUND)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if(opus_FOUND AND NOT TARGET Opus::Opus)
 | 
			
		||||
  add_library(Opus::Opus UNKNOWN IMPORTED)
 | 
			
		||||
  add_library(Opus::Opus UNKNOWN IMPORTED GLOBAL)
 | 
			
		||||
  set_target_properties(Opus::Opus PROPERTIES
 | 
			
		||||
    IMPORTED_LOCATION "${opus_LIBRARY}"
 | 
			
		||||
    INTERFACE_COMPILE_OPTIONS "${PC_opus_CFLAGS_OTHER}"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								externals/opus/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								externals/opus/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							@@ -252,3 +252,5 @@ PRIVATE
 | 
			
		||||
    opus/silk/float
 | 
			
		||||
    opus/src
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
add_library(Opus::Opus ALIAS opus)
 | 
			
		||||
 
 | 
			
		||||
@@ -673,7 +673,7 @@ endif()
 | 
			
		||||
create_target_directory_groups(core)
 | 
			
		||||
 | 
			
		||||
target_link_libraries(core PUBLIC common PRIVATE audio_core video_core)
 | 
			
		||||
target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls opus zip)
 | 
			
		||||
target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::Opus zip)
 | 
			
		||||
 | 
			
		||||
if (YUZU_ENABLE_BOXCAT)
 | 
			
		||||
    target_compile_definitions(core PRIVATE -DYUZU_ENABLE_BOXCAT)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user