Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/devel' into hwng
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolcl committed Nov 17, 2024
2 parents 51d9fc7 + 7510b7a commit 50afcdd
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 129 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cmake-freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ jobs:
env:
BUILD_TYPE: RelWithDebInfo
INSTALL_LOCATION: ${{github.workspace}}/SonivoxV3
TEMP: ${{github.workspace}}/temp/
steps:
- uses: actions/checkout@v4
- name: Temp Environment Variable
run: |
mkdir -p ${{github.workspace}}/temp
- name: FreeBSD test
id: test
uses: vmactions/freebsd-vm@v1
with:
envs: 'BUILD_TYPE INSTALL_LOCATION'
envs: 'BUILD_TYPE INSTALL_LOCATION TEMP'
usesh: true
prepare: |
pkg install -y \
Expand All @@ -33,7 +37,7 @@ jobs:
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cd ${{github.workspace}}/build
ctest -C ${{env.BUILD_TYPE}}
ctest -C ${{env.BUILD_TYPE}} --verbose
cd ${{github.workspace}}
cmake --install ${{github.workspace}}/build
tar cvf SonivoxV3.tar SonivoxV3
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/cmake-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
BUILD_TYPE: RelWithDebInfo
INSTALL_LOCATION: ${{github.workspace}}/SonivoxV3
TEMP: ${{github.workspace}}/temp/

jobs:
build:
Expand All @@ -22,6 +23,10 @@ jobs:
- name: Preparation
run: sudo apt install libgtest-dev

- name: Temp Environment Variable
run: |
mkdir -p ${{github.workspace}}/temp
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}

Expand All @@ -30,7 +35,7 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
run: ctest -C ${{env.BUILD_TYPE}} --verbose

- name: Install
run: cmake --install ${{github.workspace}}/build
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/cmake-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
BUILD_TYPE: RelWithDebInfo
INSTALL_LOCATION: ${{github.workspace}}/SonivoxV3
TEMP: ${{github.workspace}}/temp/

jobs:
build:
Expand All @@ -19,6 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Temp Environment Variable
run: |
mkdir -p ${{github.workspace}}/temp
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}

Expand All @@ -27,7 +32,7 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
run: ctest -C ${{env.BUILD_TYPE}} --verbose

- name: Install
run: cmake --install ${{github.workspace}}/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: '${{ matrix.icon }} Test'
working-directory: build
run: ctest -C ${{env.BUILD_TYPE}}
run: ctest -C ${{env.BUILD_TYPE}} --verbose

- name: '${{ matrix.icon }} Install'
run: cmake --install build
Expand Down
50 changes: 25 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ include(GNUInstallDirs)

if (BUILD_TESTING)
find_package(GTest CONFIG)
if (NOT GTest_FOUND)
if (GTest_FOUND)
message( STATUS "Found GTest v${GTest_VERSION}")
else()
message( STATUS "GTest not found. Fetching the git repository..." )
set( INSTALL_GTEST OFF CACHE BOOL "Enable installation of gooogletest" FORCE )
set( BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE )
include( FetchContent )
FetchContent_Declare( googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
GIT_REPOSITORY "https://github.com/google/googletest.git"
GIT_TAG "v1.15.2"
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set( gtest_force_shared_crt ON CACHE BOOL "" FORCE )
Expand All @@ -61,7 +63,7 @@ endif()

if (UNIX AND NOT APPLE)
find_library(MATH_LIBRARY m)
message(STATUS "Math library: ${MATH_LIBRARY}")
message(STATUS "Found Math library: ${MATH_LIBRARY}")
else()
set(MATH_LIBRARY "")
endif()
Expand Down Expand Up @@ -149,28 +151,20 @@ target_compile_definitions( sonivox-objects PRIVATE
include(TestBigEndian)
test_big_endian(BIG_ENDIAN)

if (BIG_ENDIAN)
if (BIG_ENDIAN)
target_compile_definitions( sonivox-objects PRIVATE EAS_BIG_ENDIAN )
endif()

if (USE_16BITS_SAMPLES)
target_compile_definitions( sonivox-objects PRIVATE
_16_BIT_SAMPLES
)
target_compile_definitions( sonivox-objects PRIVATE _16_BIT_SAMPLES )
else()
target_compile_definitions( sonivox-objects PRIVATE
_8_BIT_SAMPLES
)
target_compile_definitions( sonivox-objects PRIVATE _8_BIT_SAMPLES )
endif()

if(USE_44KHZ)
target_compile_definitions( sonivox-objects PRIVATE
_SAMPLE_RATE_44100
)
target_compile_definitions( sonivox-objects PRIVATE _SAMPLE_RATE_44100 )
else()
target_compile_definitions( sonivox-objects PRIVATE
_SAMPLE_RATE_22050
)
target_compile_definitions( sonivox-objects PRIVATE _SAMPLE_RATE_22050 )
endif()

target_include_directories( sonivox-objects PRIVATE
Expand Down Expand Up @@ -283,17 +277,13 @@ if (BUILD_TESTING)
enable_testing()

add_executable( SonivoxTest
test/SonivoxTest.cpp
test/SonivoxTest.cpp
)

if(USE_44KHZ)
target_compile_definitions( SonivoxTest PRIVATE
_SAMPLE_RATE_44100
)
target_compile_definitions( SonivoxTest PRIVATE _SAMPLE_RATE_44100 )
else()
target_compile_definitions( SonivoxTest PRIVATE
_SAMPLE_RATE_22050
)
target_compile_definitions( SonivoxTest PRIVATE _SAMPLE_RATE_22050 )
endif()

target_include_directories( SonivoxTest PRIVATE
Expand All @@ -303,7 +293,7 @@ if (BUILD_TESTING)
)

target_link_libraries( SonivoxTest PRIVATE
GTest::gtest_main
GTest::gtest_main
)

if (BUILD_SONIVOX_STATIC)
Expand All @@ -316,6 +306,16 @@ if (BUILD_TESTING)
)
endif()

set(SOUNDFONT "$ENV{TEMP}/soundfont.dls")
if (NOT EXISTS ${SOUNDFONT})
file(DOWNLOAD "http://www.ronimusic.com/sf2/Airfont_340.dls" ${SOUNDFONT})
endif()

file(SIZE ${SOUNDFONT} SOUNDFONTSIZE)
file(MD5 ${SOUNDFONT} SOUNDFONTHASH)
message(STATUS "DLS file ${SOUNDFONT} size: ${SOUNDFONTSIZE}")
message(STATUS "DLS file ${SOUNDFONT} MD5 hash: ${SOUNDFONTHASH}")

include( GoogleTest )
gtest_discover_tests( SonivoxTest EXTRA_ARGS "-P${CMAKE_CURRENT_SOURCE_DIR}/test/res/" DISCOVERY_TIMEOUT 300 )
endif()
Expand Down
Loading

0 comments on commit 50afcdd

Please sign in to comment.