Skip to content

Commit

Permalink
Merge from Perforce 2024-12-17 10:42:21.435441
Browse files Browse the repository at this point in the history
  • Loading branch information
lakulish committed Dec 17, 2024
1 parent 3a030b0 commit 4824e8c
Show file tree
Hide file tree
Showing 288 changed files with 22,594 additions and 1,523 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Steam Audio 4.5.3
# Steam Audio 4.6.0

Valve Corporation

Expand All @@ -8,7 +8,7 @@ Steam Audio supports Windows (32 bit and 64 bit), Linux (32 bit and 64 bit), mac

## Supported Integrations

Steam Audio supports Unity 2017.3+, Unreal Engine 4.27+, and FMOD Studio 2.0+.
Steam Audio supports Unity 2017.3+, Unreal Engine 4.27+, FMOD Studio 2.0+, and Wwise 2023.1+.

## Additional Links

Expand Down
31 changes: 27 additions & 4 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

cmake_minimum_required(VERSION 3.17)

project(Phonon VERSION 4.5.3)
project(Phonon VERSION 4.6.0)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH "${CMAKE_HOME_DIRECTORY}/build")
Expand All @@ -37,6 +37,8 @@ elseif (APPLE AND (CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUA
if (CMAKE_XCODE_ATTRIBUTE_SDKROOT STREQUAL "iphonesimulator")
set(IPL_IOS_SIMULATOR TRUE)
endif()
elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(IPL_OS_WASM TRUE)
endif()

# CPU architecture detection
Expand Down Expand Up @@ -69,6 +71,8 @@ elseif (IPL_OS_ANDROID)
endif()
elseif (IPL_OS_IOS)
set(IPL_CPU_ARMV8 TRUE)
elseif (IPL_OS_WASM)
set(IPL_CPU_ARMV7 TRUE)
endif()


Expand Down Expand Up @@ -102,7 +106,7 @@ if ((IPL_OS_WINDOWS AND (IPL_CPU_X86 OR IPL_CPU_X64)) OR (IPL_OS_LINUX AND (IPL_
endif()

if (IPL_OS_ANDROID)
option(STEAMAUDIO_ENABLE_FFTS "Enable FFTS for FFT operations." ON)
option(STEAMAUDIO_ENABLE_FFTS "Enable FFTS for FFT operations." OFF)
endif()

if (IPL_OS_WINDOWS AND IPL_CPU_X64)
Expand Down Expand Up @@ -131,6 +135,9 @@ endif()
if (IPL_OS_IOS)
add_definitions(-DIPL_OS_IOS)
endif()
if (IPL_OS_WASM)
add_definitions(-DIPL_OS_WASM)
endif()

if (IPL_CPU_X86)
add_definitions(-DIPL_CPU_X86)
Expand Down Expand Up @@ -214,6 +221,12 @@ endif()
# iOS flags
# todo

# WASM flags
if (IPL_OS_WASM)
add_compile_options(-msimd128 -mfpu=neon)
add_link_options(-sALLOW_MEMORY_GROWTH=1 -sSINGLE_FILE=1)
endif()


#
# DEPENDENCIES
Expand Down Expand Up @@ -296,9 +309,10 @@ endif()
if (STEAMAUDIO_BUILD_ITESTS)
find_package(GLFW)
find_package(IMGUI)
find_package(IMPLOT)
find_package(PortAudio)
find_package(DRWAV)
if (NOT GLFW_FOUND OR NOT IMGUI_FOUND OR NOT PortAudio_FOUND OR NOT DRWAV_FOUND)
if (NOT GLFW_FOUND OR NOT IMGUI_FOUND OR NOT IMPLOT_FOUND OR NOT PortAudio_FOUND OR NOT DRWAV_FOUND)
message(STATUS "Disabling interactive tests")
set(STEAMAUDIO_BUILD_ITESTS OFF)
endif()
Expand All @@ -316,7 +330,15 @@ if (STEAMAUDIO_BUILD_DOCS)
endif()
endif()

include(CMakeListsInternal.txt OPTIONAL)
include(CMakeListsInternal.txt OPTIONAL RESULT_VARIABLE STEAMAUDIO_INTERNAL_MODE)
if (NOT STEAMAUDIO_INTERNAL_MODE)
set(STEAMAUDIO_PROFILING_TOOLS "None;Generic")
set(STEAMAUDIO_PROFILING_TOOL "None" CACHE STRING "${STEAMAUDIO_PROFILING_TOOLS}")

if(NOT STEAMAUDIO_PROFILING_TOOL IN_LIST STEAMAUDIO_PROFILING_TOOLS)
message(FATAL_ERROR "Invalid option selected: ${STEAMAUDIO_PROFILING_TOOL}. Must be one of: ${STEAMAUDIO_PROFILING_TOOLS}.")
endif()
endif()

# Flags determined by options
if (STEAMAUDIO_ENABLE_AVX)
Expand Down Expand Up @@ -407,6 +429,7 @@ set(CPACK_INSTALLED_DIRECTORIES
${CMAKE_INSTALL_PREFIX}/lib/android-x86 lib/android-x86
${CMAKE_INSTALL_PREFIX}/lib/android-x64 lib/android-x64
${CMAKE_INSTALL_PREFIX}/lib/ios lib/ios
${CMAKE_INSTALL_PREFIX}/lib/wasm lib/wasm
${CMAKE_INSTALL_PREFIX}/doc doc
${CMAKE_INSTALL_PREFIX}/symbols/windows-x86 symbols/windows-x86
${CMAKE_INSTALL_PREFIX}/symbols/windows-x64 symbols/windows-x64
Expand Down
42 changes: 42 additions & 0 deletions core/build/FindImPlot.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2017-2023 Valve Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include(FindPackageHandleStandardArgs)

find_path(IMPLOT_INCLUDE_DIR
NAMES implot.h
PATHS ${CMAKE_HOME_DIRECTORY}/deps/implot/include
)

find_package_handle_standard_args(IMPLOT
FOUND_VAR IMPLOT_FOUND
REQUIRED_VARS IMPLOT_INCLUDE_DIR
)

if (IMPLOT_FOUND)
if (NOT TARGET IMPLOT::IMPLOT)
add_library(IMPLOT INTERFACE)
target_include_directories(IMPLOT INTERFACE ${IMPLOT_INCLUDE_DIR})
target_sources(IMPLOT INTERFACE
${IMPLOT_INCLUDE_DIR}/implot.h
${IMPLOT_INCLUDE_DIR}/implot_internal.h
${IMPLOT_INCLUDE_DIR}/implot.cpp
${IMPLOT_INCLUDE_DIR}/implot_items.cpp
)

add_library(IMPLOT::IMPLOT ALIAS IMPLOT)
endif()
endif()

mark_as_advanced(IMPLOT_INCLUDE_DIR)
4 changes: 4 additions & 0 deletions core/build/SteamAudioHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function (get_local_lib_path LIB_PATH)
else()
set(${LIB_PATH} ${CMAKE_HOME_DIRECTORY}/lib/ios PARENT_SCOPE)
endif()
elseif (IPL_OS_WASM)
set(${LIB_PATH} ${CMAKE_HOME_DIRECTORY}/lib/wasm PARENT_SCOPE)
endif()
endfunction()

Expand Down Expand Up @@ -85,6 +87,8 @@ function (get_bin_subdir BIN_SUBDIR)
else()
set(${BIN_SUBDIR} ios PARENT_SCOPE)
endif()
elseif (IPL_OS_WASM)
set(${BIN_SUBDIR} wasm PARENT_SCOPE)
endif()
endfunction()

Expand Down
35 changes: 31 additions & 4 deletions core/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ def detect_host_system():
# Parses the command line.
def parse_command_line(host_system):
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--platform', help = "Target operating system.", choices = ['windows', 'osx', 'linux', 'android', 'ios'], type = str.lower, default = host_system)
parser.add_argument('-p', '--platform', help = "Target operating system.", choices = ['windows', 'osx', 'linux', 'android', 'ios', 'wasm'], type = str.lower, default = host_system)
parser.add_argument('-t', '--toolchain', help = "Compiler toolchain. (Windows only)", choices = ['vs2013', 'vs2015', 'vs2017', 'vs2019', 'vs2022'], type = str.lower, default = 'vs2019')
parser.add_argument('-a', '--architecture', help = "CPU architecture.", choices = ['x86', 'x64', 'armv7', 'arm64'], type = str.lower, default = 'x64')
parser.add_argument('-c', '--configuration', help = "Build configuration.", choices = ['debug', 'release'], type = str.lower, default = 'release')
parser.add_argument('-o', '--operation', help = "CMake operation.", choices = ['generate', 'build', 'test', 'install', 'package', 'default', 'ci_build', 'ci_package'], type = str.lower, default = 'default')
parser.add_argument('--minimal', action='store_true', help='Use build options that minimize dependencies.')
parser.add_argument('--unity', action='store_true', help='Configure a unity build (for improved build performance on CI systems).')
parser.add_argument('--parallel', type=int, default=0, help='Number of threads to use when building. 0 = no threading.')
args = parser.parse_args()
return args

Expand All @@ -50,6 +52,8 @@ def build_subdir(args):
return args.platform
elif args.platform in ['linux', 'android']:
return "-".join([args.platform, args.architecture, args.configuration])
elif args.platform in ['wasm']:
return "-".join([args.platform, args.configuration])

# Returns the root directory of the repository.
def root_dir():
Expand All @@ -58,8 +62,8 @@ def root_dir():
# Returns the generator name to pass to CMake, based on the platform.
def generator_name(args):
if args.platform == 'windows':
suffix = '';
generator = '';
suffix = ''
generator = ''
if args.toolchain == 'vs2013':
generator = 'Visual Studio 12 2013'
elif args.toolchain == 'vs2015':
Expand All @@ -73,7 +77,7 @@ def generator_name(args):
return generator + suffix
elif args.platform in ['osx', 'ios']:
return 'Xcode'
elif args.platform in ['linux', 'android']:
elif args.platform in ['linux', 'android', 'wasm']:
return 'Unix Makefiles'

# Returns the configuration name to pass to CMake.
Expand All @@ -88,6 +92,8 @@ def run_cmake(program_name, args):
env = os.environ.copy()
if os.getenv('STEAMAUDIO_OVERRIDE_PYTHONPATH') is not None:
env['PYTHONPATH'] = ''
if os.getenv('STEAMAUDIO_OVERRIDE_SDKROOT') is not None:
env['SDKROOT'] = ''

subprocess.check_call([program_name] + args, env=env)

Expand Down Expand Up @@ -135,6 +141,14 @@ def cmake_generate(args):
elif args.platform == 'ios':
cmake_args += ['-DCMAKE_TOOLCHAIN_FILE=' + root_dir() + '/build/toolchain_ios.cmake']

elif args.platform == 'wasm':
cmake_args += ['-DCMAKE_TOOLCHAIN_FILE=' + os.environ.get('EMSDK') + '/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake']
cmake_args += ['-DBUILD_SHARED_LIBS=FALSE']
cmake_args += ['-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH']
cmake_args += ['-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH']
cmake_args += ['-DEMSCRIPTEN_SYSTEM_PROCESSOR=arm']
cmake_args += ['-DCMAKE_BUILD_TYPE=' + config_name(args)]

# Install files to bin/.
cmake_args += ['-DCMAKE_INSTALL_PREFIX=' + root_dir() + '/bin']

Expand All @@ -149,6 +163,10 @@ def cmake_generate(args):
cmake_args += ['-DSTEAMAUDIO_ENABLE_RADEONRAYS=FALSE']
cmake_args += ['-DSTEAMAUDIO_ENABLE_TRUEAUDIONEXT=FALSE']

# If specified, enable unity builds.
if args.unity:
cmake_args += ['-DCMAKE_UNITY_BUILD=TRUE']

cmake_args += ['../..']

run_cmake('cmake', cmake_args)
Expand All @@ -160,6 +178,10 @@ def cmake_build(args):
if args.platform in ['windows', 'osx', 'ios']:
cmake_args += ['--config', config_name(args)]

# If specified, build using multiple threads.
if args.parallel > 0:
cmake_args += ['--parallel', str(args.parallel)]

run_cmake('cmake', cmake_args)

# Runs the "test" step.
Expand Down Expand Up @@ -275,6 +297,11 @@ def find_tool(name, dir_regex, min_version):
else:
os.environ['PATH'] = os.path.normpath(os.path.join(cmake_path, 'bin')) + os.pathsep + os.environ['PATH']

# CI defaults.
if args.operation == 'ci_build':
args.unity = True
args.parallel = 4

if args.operation == 'generate':
cmake_generate(args)
elif args.operation == 'build':
Expand Down
63 changes: 60 additions & 3 deletions core/build/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@
"-DTARGET_C_EXTRA=neon",
"-DTARGET_CXX_EXTRA=neon"
]
},
{
"platforms": ["wasm"],
"flags": [
"-DEMSCRIPTEN_SYSTEM_PROCESSOR=armv7l",
"-DCMAKE_C_FLAGS=-msimd128 -mfpu=neon -DPFFFT_ENABLE_NEON=1 -D__arm__=1",
"-DCMAKE_CXX_FLAGS=-msimd128 -mfpu=neon -DPFFFT_ENABLE_NEON=1 -D__arm__=1"
]
}
]
},
Expand All @@ -150,14 +158,28 @@
},
"fetch": {
"git": "https://github.com/linkotec/ffts.git",
"tag": "2c8da4877588e288ff4cd550f14bec2dc7bf668c"
"tag": "2c8da4877588e288ff4cd550f14bec2dc7bf668c",
"patch": "ffts.patch"
},
"configure": {
"cmake": [
{
"platforms": ["android-arm64", "android-x86", "android-x64"],
"flags": [
"-DDISABLE_DYNAMIC_CODE=ON"
]
},
{
"platforms": ["android-armv7"],
"flags": [
"-DENABLE_NEON=ON"
]
},
{
"platforms": ["android-arm64"],
"flags": [
"-DENABLE_NEON=OFF"
]
}
]
},
Expand Down Expand Up @@ -198,7 +220,16 @@
"patch": "zlib.patch"
},
"configure": {
"cmake": []
"cmake": [
{
"platforms": ["wasm"],
"flags": [
"-DEMSCRIPTEN_SYSTEM_PROCESSOR=arm",
"-DCMAKE_C_FLAGS=-msimd128 -mfpu=neon -D__arm__=1",
"-DCMAKE_CXX_FLAGS=-msimd128 -mfpu=neon -D__arm__=1"
]
}
]
},
"build": {
"cmake": {
Expand Down Expand Up @@ -249,9 +280,19 @@
{
"stamp": false,
"flags": [
"-DZLIB_ROOT=$deps/zlib/lib/$platform",
"-DZLIB_ROOT=$deps/zlib/lib/$platform/$config",
"-DZLIB_INCLUDE_DIR=$deps/zlib/include"
]
},
{
"platforms": ["wasm"],
"flags": [
"-DEMSCRIPTEN_SYSTEM_PROCESSOR=arm",
"-DCMAKE_C_FLAGS=-msimd128 -mfpu=neon -D__linux__ -D__arm__=1",
"-DCMAKE_CXX_FLAGS=-msimd128 -mfpu=neon -D__linux__ -D__arm__=1",
"-DWIN32=1",
"-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH"
]
}
]
},
Expand Down Expand Up @@ -537,6 +578,22 @@
["src/imgui/backends/imgui_impl_glfw.cpp", "include"]
]
},
"implot": {
"platforms": ["windows-x64"],
"check": {
"headers": ["implot.h"]
},
"fetch": {
"git": "https://github.com/epezent/implot.git",
"tag": "f156599faefe316f7dd20fe6c783bf87c8bb6fd9"
},
"copy": [
["src/implot/implot.h", "include"],
["src/implot/implot_internal.h", "include"],
["src/implot/implot.cpp", "include"],
["src/implot/implot_items.cpp", "include"]
]
},
"portaudio": {
"platforms": ["windows-x64"],
"check": {
Expand Down
Loading

0 comments on commit 4824e8c

Please sign in to comment.