diff options
| author | 2020-07-01 15:09:33 +1000 | |
|---|---|---|
| committer | 2020-07-01 15:09:33 +1000 | |
| commit | d5dfe34c4935d1494f4b742fa3bb4066d9096236 (patch) | |
| tree | bbd2db9128c5590763397d1aa9c00dce26922e1d | |
| parent | Merge pull request #4208 from jbeich/freebsd (diff) | |
| download | yuzu-d5dfe34c4935d1494f4b742fa3bb4066d9096236.tar.gz yuzu-d5dfe34c4935d1494f4b742fa3bb4066d9096236.tar.xz yuzu-d5dfe34c4935d1494f4b742fa3bb4066d9096236.zip | |
externals: Track opus as submodule instead of using conan
Supersedes #4068 see for details.
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | CMakeLists.txt | 2 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | externals/opus/CMakeLists.txt | 254 | ||||
| m--------- | externals/opus/opus | 0 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 |
6 files changed, 261 insertions, 3 deletions
diff --git a/.gitmodules b/.gitmodules index 9ba8fe207..6fa823c1c 100644 --- a/.gitmodules +++ b/.gitmodules | |||
| @@ -34,3 +34,6 @@ | |||
| 34 | [submodule "xbyak"] | 34 | [submodule "xbyak"] |
| 35 | path = externals/xbyak | 35 | path = externals/xbyak |
| 36 | url = https://github.com/herumi/xbyak.git | 36 | url = https://github.com/herumi/xbyak.git |
| 37 | [submodule "opus"] | ||
| 38 | path = externals/opus/opus | ||
| 39 | url = https://github.com/xiph/opus.git | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt index 73405ce4b..d0af994da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -156,8 +156,6 @@ macro(yuzu_find_packages) | |||
| 156 | #"libzip 1.5 libzip/1.5.2@bincrafters/stable" | 156 | #"libzip 1.5 libzip/1.5.2@bincrafters/stable" |
| 157 | "lz4 1.8 lz4/1.9.2" | 157 | "lz4 1.8 lz4/1.9.2" |
| 158 | "nlohmann_json 3.7 nlohmann_json/3.7.3" | 158 | "nlohmann_json 3.7 nlohmann_json/3.7.3" |
| 159 | # we need to be careful as the version check might be broken https://github.com/xiph/opus/issues/110 | ||
| 160 | "opus 1.3 opus/1.3.1" | ||
| 161 | "ZLIB 1.2 zlib/1.2.11" | 159 | "ZLIB 1.2 zlib/1.2.11" |
| 162 | "zstd 1.4 zstd/1.4.4" | 160 | "zstd 1.4 zstd/1.4.4" |
| 163 | ) | 161 | ) |
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index b80b27605..d1dcc403b 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -91,3 +91,6 @@ if (ENABLE_WEB_SERVICE) | |||
| 91 | target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT) | 91 | target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT) |
| 92 | target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES}) | 92 | target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES}) |
| 93 | endif() | 93 | endif() |
| 94 | |||
| 95 | # Opus | ||
| 96 | add_subdirectory(opus) | ||
diff --git a/externals/opus/CMakeLists.txt b/externals/opus/CMakeLists.txt new file mode 100644 index 000000000..94a86551f --- /dev/null +++ b/externals/opus/CMakeLists.txt | |||
| @@ -0,0 +1,254 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.8) | ||
| 2 | |||
| 3 | project(opus) | ||
| 4 | |||
| 5 | option(OPUS_STACK_PROTECTOR "Use stack protection" OFF) | ||
| 6 | option(OPUS_USE_ALLOCA "Use alloca for stack arrays (on non-C99 compilers)" OFF) | ||
| 7 | option(OPUS_CUSTOM_MODES "Enable non-Opus modes, e.g. 44.1 kHz & 2^n frames" OFF) | ||
| 8 | option(OPUS_FIXED_POINT "Compile as fixed-point (for machines without a fast enough FPU)" OFF) | ||
| 9 | option(OPUS_ENABLE_FLOAT_API "Compile with the floating point API (for machines with float library" ON) | ||
| 10 | |||
| 11 | include(opus/opus_functions.cmake) | ||
| 12 | |||
| 13 | if(OPUS_STACK_PROTECTOR) | ||
| 14 | if(NOT MSVC) # GC on by default on MSVC | ||
| 15 | check_and_set_flag(STACK_PROTECTION_STRONG -fstack-protector-strong) | ||
| 16 | endif() | ||
| 17 | else() | ||
| 18 | if(MSVC) | ||
| 19 | check_and_set_flag(BUFFER_SECURITY_CHECK /GS-) | ||
| 20 | endif() | ||
| 21 | endif() | ||
| 22 | |||
| 23 | add_library(opus STATIC | ||
| 24 | # CELT sources | ||
| 25 | opus/celt/bands.c | ||
| 26 | opus/celt/celt.c | ||
| 27 | opus/celt/celt_decoder.c | ||
| 28 | opus/celt/celt_encoder.c | ||
| 29 | opus/celt/celt_lpc.c | ||
| 30 | opus/celt/cwrs.c | ||
| 31 | opus/celt/entcode.c | ||
| 32 | opus/celt/entdec.c | ||
| 33 | opus/celt/entenc.c | ||
| 34 | opus/celt/kiss_fft.c | ||
| 35 | opus/celt/laplace.c | ||
| 36 | opus/celt/mathops.c | ||
| 37 | opus/celt/mdct.c | ||
| 38 | opus/celt/modes.c | ||
| 39 | opus/celt/pitch.c | ||
| 40 | opus/celt/quant_bands.c | ||
| 41 | opus/celt/rate.c | ||
| 42 | opus/celt/vq.c | ||
| 43 | |||
| 44 | # SILK sources | ||
| 45 | opus/silk/A2NLSF.c | ||
| 46 | opus/silk/CNG.c | ||
| 47 | opus/silk/HP_variable_cutoff.c | ||
| 48 | opus/silk/LPC_analysis_filter.c | ||
| 49 | opus/silk/LPC_fit.c | ||
| 50 | opus/silk/LPC_inv_pred_gain.c | ||
| 51 | opus/silk/LP_variable_cutoff.c | ||
| 52 | opus/silk/NLSF2A.c | ||
| 53 | opus/silk/NLSF_VQ.c | ||
| 54 | opus/silk/NLSF_VQ_weights_laroia.c | ||
| 55 | opus/silk/NLSF_decode.c | ||
| 56 | opus/silk/NLSF_del_dec_quant.c | ||
| 57 | opus/silk/NLSF_encode.c | ||
| 58 | opus/silk/NLSF_stabilize.c | ||
| 59 | opus/silk/NLSF_unpack.c | ||
| 60 | opus/silk/NSQ.c | ||
| 61 | opus/silk/NSQ_del_dec.c | ||
| 62 | opus/silk/PLC.c | ||
| 63 | opus/silk/VAD.c | ||
| 64 | opus/silk/VQ_WMat_EC.c | ||
| 65 | opus/silk/ana_filt_bank_1.c | ||
| 66 | opus/silk/biquad_alt.c | ||
| 67 | opus/silk/bwexpander.c | ||
| 68 | opus/silk/bwexpander_32.c | ||
| 69 | opus/silk/check_control_input.c | ||
| 70 | opus/silk/code_signs.c | ||
| 71 | opus/silk/control_SNR.c | ||
| 72 | opus/silk/control_audio_bandwidth.c | ||
| 73 | opus/silk/control_codec.c | ||
| 74 | opus/silk/dec_API.c | ||
| 75 | opus/silk/decode_core.c | ||
| 76 | opus/silk/decode_frame.c | ||
| 77 | opus/silk/decode_indices.c | ||
| 78 | opus/silk/decode_parameters.c | ||
| 79 | opus/silk/decode_pitch.c | ||
| 80 | opus/silk/decode_pulses.c | ||
| 81 | opus/silk/decoder_set_fs.c | ||
| 82 | opus/silk/enc_API.c | ||
| 83 | opus/silk/encode_indices.c | ||
| 84 | opus/silk/encode_pulses.c | ||
| 85 | opus/silk/gain_quant.c | ||
| 86 | opus/silk/init_decoder.c | ||
| 87 | opus/silk/init_encoder.c | ||
| 88 | opus/silk/inner_prod_aligned.c | ||
| 89 | opus/silk/interpolate.c | ||
| 90 | opus/silk/lin2log.c | ||
| 91 | opus/silk/log2lin.c | ||
| 92 | opus/silk/pitch_est_tables.c | ||
| 93 | opus/silk/process_NLSFs.c | ||
| 94 | opus/silk/quant_LTP_gains.c | ||
| 95 | opus/silk/resampler.c | ||
| 96 | opus/silk/resampler_down2.c | ||
| 97 | opus/silk/resampler_down2_3.c | ||
| 98 | opus/silk/resampler_private_AR2.c | ||
| 99 | opus/silk/resampler_private_IIR_FIR.c | ||
| 100 | opus/silk/resampler_private_down_FIR.c | ||
| 101 | opus/silk/resampler_private_up2_HQ.c | ||
| 102 | opus/silk/resampler_rom.c | ||
| 103 | opus/silk/shell_coder.c | ||
| 104 | opus/silk/sigm_Q15.c | ||
| 105 | opus/silk/sort.c | ||
| 106 | opus/silk/stereo_LR_to_MS.c | ||
| 107 | opus/silk/stereo_MS_to_LR.c | ||
| 108 | opus/silk/stereo_decode_pred.c | ||
| 109 | opus/silk/stereo_encode_pred.c | ||
| 110 | opus/silk/stereo_find_predictor.c | ||
| 111 | opus/silk/stereo_quant_pred.c | ||
| 112 | opus/silk/sum_sqr_shift.c | ||
| 113 | opus/silk/table_LSF_cos.c | ||
| 114 | opus/silk/tables_LTP.c | ||
| 115 | opus/silk/tables_NLSF_CB_NB_MB.c | ||
| 116 | opus/silk/tables_NLSF_CB_WB.c | ||
| 117 | opus/silk/tables_gain.c | ||
| 118 | opus/silk/tables_other.c | ||
| 119 | opus/silk/tables_pitch_lag.c | ||
| 120 | opus/silk/tables_pulses_per_block.c | ||
| 121 | |||
| 122 | # Opus sources | ||
| 123 | opus/src/analysis.c | ||
| 124 | opus/src/mapping_matrix.c | ||
| 125 | opus/src/mlp.c | ||
| 126 | opus/src/mlp_data.c | ||
| 127 | opus/src/opus.c | ||
| 128 | opus/src/opus_decoder.c | ||
| 129 | opus/src/opus_encoder.c | ||
| 130 | opus/src/opus_multistream.c | ||
| 131 | opus/src/opus_multistream_decoder.c | ||
| 132 | opus/src/opus_multistream_encoder.c | ||
| 133 | opus/src/opus_projection_decoder.c | ||
| 134 | opus/src/opus_projection_encoder.c | ||
| 135 | opus/src/repacketizer.c | ||
| 136 | ) | ||
| 137 | |||
| 138 | if (DEBUG) | ||
| 139 | target_sources(opus PRIVATE opus/silk/debug.c) | ||
| 140 | endif() | ||
| 141 | |||
| 142 | if (OPUS_FIXED_POINT) | ||
| 143 | target_sources(opus PRIVATE | ||
| 144 | opus/silk/fixed/LTP_analysis_filter_FIX.c | ||
| 145 | opus/silk/fixed/LTP_scale_ctrl_FIX.c | ||
| 146 | opus/silk/fixed/apply_sine_window_FIX.c | ||
| 147 | opus/silk/fixed/autocorr_FIX.c | ||
| 148 | opus/silk/fixed/burg_modified_FIX.c | ||
| 149 | opus/silk/fixed/corrMatrix_FIX.c | ||
| 150 | opus/silk/fixed/encode_frame_FIX.c | ||
| 151 | opus/silk/fixed/find_LPC_FIX.c | ||
| 152 | opus/silk/fixed/find_LTP_FIX.c | ||
| 153 | opus/silk/fixed/find_pitch_lags_FIX.c | ||
| 154 | opus/silk/fixed/find_pred_coefs_FIX.c | ||
| 155 | opus/silk/fixed/k2a_FIX.c | ||
| 156 | opus/silk/fixed/k2a_Q16_FIX.c | ||
| 157 | opus/silk/fixed/noise_shape_analysis_FIX.c | ||
| 158 | opus/silk/fixed/pitch_analysis_core_FIX.c | ||
| 159 | opus/silk/fixed/prefilter_FIX.c | ||
| 160 | opus/silk/fixed/process_gains_FIX.c | ||
| 161 | opus/silk/fixed/regularize_correlations_FIX.c | ||
| 162 | opus/silk/fixed/residual_energy16_FIX.c | ||
| 163 | opus/silk/fixed/residual_energy_FIX.c | ||
| 164 | opus/silk/fixed/schur64_FIX.c | ||
| 165 | opus/silk/fixed/schur_FIX.c | ||
| 166 | opus/silk/fixed/solve_LS_FIX.c | ||
| 167 | opus/silk/fixed/vector_ops_FIX.c | ||
| 168 | opus/silk/fixed/warped_autocorrelation_FIX.c | ||
| 169 | ) | ||
| 170 | else() | ||
| 171 | target_sources(opus PRIVATE | ||
| 172 | opus/silk/float/LPC_analysis_filter_FLP.c | ||
| 173 | opus/silk/float/LPC_inv_pred_gain_FLP.c | ||
| 174 | opus/silk/float/LTP_analysis_filter_FLP.c | ||
| 175 | opus/silk/float/LTP_scale_ctrl_FLP.c | ||
| 176 | opus/silk/float/apply_sine_window_FLP.c | ||
| 177 | opus/silk/float/autocorrelation_FLP.c | ||
| 178 | opus/silk/float/burg_modified_FLP.c | ||
| 179 | opus/silk/float/bwexpander_FLP.c | ||
| 180 | opus/silk/float/corrMatrix_FLP.c | ||
| 181 | opus/silk/float/encode_frame_FLP.c | ||
| 182 | opus/silk/float/energy_FLP.c | ||
| 183 | opus/silk/float/find_LPC_FLP.c | ||
| 184 | opus/silk/float/find_LTP_FLP.c | ||
| 185 | opus/silk/float/find_pitch_lags_FLP.c | ||
| 186 | opus/silk/float/find_pred_coefs_FLP.c | ||
| 187 | opus/silk/float/inner_product_FLP.c | ||
| 188 | opus/silk/float/k2a_FLP.c | ||
| 189 | opus/silk/float/noise_shape_analysis_FLP.c | ||
| 190 | opus/silk/float/pitch_analysis_core_FLP.c | ||
| 191 | opus/silk/float/process_gains_FLP.c | ||
| 192 | opus/silk/float/regularize_correlations_FLP.c | ||
| 193 | opus/silk/float/residual_energy_FLP.c | ||
| 194 | opus/silk/float/scale_copy_vector_FLP.c | ||
| 195 | opus/silk/float/scale_vector_FLP.c | ||
| 196 | opus/silk/float/schur_FLP.c | ||
| 197 | opus/silk/float/sort_FLP.c | ||
| 198 | opus/silk/float/warped_autocorrelation_FLP.c | ||
| 199 | opus/silk/float/wrappers_FLP.c | ||
| 200 | ) | ||
| 201 | endif() | ||
| 202 | |||
| 203 | target_compile_definitions(opus PRIVATE OPUS_BUILD ENABLE_HARDENING) | ||
| 204 | |||
| 205 | if(NOT MSVC) | ||
| 206 | if(MINGW) | ||
| 207 | target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=0) | ||
| 208 | else() | ||
| 209 | target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=2) | ||
| 210 | endif() | ||
| 211 | endif() | ||
| 212 | |||
| 213 | # It is strongly recommended to uncomment one of these VAR_ARRAYS: Use C99 | ||
| 214 | # variable-length arrays for stack allocation USE_ALLOCA: Use alloca() for stack | ||
| 215 | # allocation If none is defined, then the fallback is a non-threadsafe global | ||
| 216 | # array | ||
| 217 | if(OPUS_USE_ALLOCA OR MSVC) | ||
| 218 | target_compile_definitions(opus PRIVATE USE_ALLOCA) | ||
| 219 | else() | ||
| 220 | target_compile_definitions(opus PRIVATE VAR_ARRAYS) | ||
| 221 | endif() | ||
| 222 | |||
| 223 | if(OPUS_CUSTOM_MODES) | ||
| 224 | target_compile_definitions(opus PRIVATE CUSTOM_MODES) | ||
| 225 | endif() | ||
| 226 | |||
| 227 | if(NOT OPUS_ENABLE_FLOAT_API) | ||
| 228 | target_compile_definitions(opus PRIVATE DISABLE_FLOAT_API) | ||
| 229 | endif() | ||
| 230 | |||
| 231 | target_compile_definitions(opus | ||
| 232 | PUBLIC | ||
| 233 | -DOPUS_VERSION="\\"1.3.1\\"" | ||
| 234 | |||
| 235 | PRIVATE | ||
| 236 | # Use C99 intrinsics to speed up float-to-int conversion | ||
| 237 | HAVE_LRINTF | ||
| 238 | ) | ||
| 239 | |||
| 240 | if (FIXED_POINT) | ||
| 241 | target_compile_definitions(opus PRIVATE -DFIXED_POINT=1 -DDISABLE_FLOAT_API) | ||
| 242 | endif() | ||
| 243 | |||
| 244 | target_include_directories(opus | ||
| 245 | PUBLIC | ||
| 246 | opus/include | ||
| 247 | |||
| 248 | PRIVATE | ||
| 249 | opus/celt | ||
| 250 | opus/silk | ||
| 251 | opus/silk/fixed | ||
| 252 | opus/silk/float | ||
| 253 | opus/src | ||
| 254 | ) | ||
diff --git a/externals/opus/opus b/externals/opus/opus new file mode 160000 | |||
| Subproject ad8fe90db79b7d2a135e3dfd2ed6631b0c5662a | |||
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f87d67db5..d1f173f42 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -614,7 +614,7 @@ endif() | |||
| 614 | create_target_directory_groups(core) | 614 | create_target_directory_groups(core) |
| 615 | 615 | ||
| 616 | target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) | 616 | target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) |
| 617 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::Opus unicorn zip) | 617 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls opus unicorn zip) |
| 618 | 618 | ||
| 619 | if (YUZU_ENABLE_BOXCAT) | 619 | if (YUZU_ENABLE_BOXCAT) |
| 620 | target_compile_definitions(core PRIVATE -DYUZU_ENABLE_BOXCAT) | 620 | target_compile_definitions(core PRIVATE -DYUZU_ENABLE_BOXCAT) |