diff --git a/.azure/azure-pipelines-mac.yml b/.azure/azure-pipelines-mac.yml index 90be1439c..9fa1596f1 100644 --- a/.azure/azure-pipelines-mac.yml +++ b/.azure/azure-pipelines-mac.yml @@ -113,6 +113,16 @@ jobs: echo $? displayName: 'Consume from pkg-config' condition: and(succeeded(), contains(variables.CMakeFlags, 'Denable-framework=0')) + # regression test for #1266 + - script: | + set -e + rm -rf build + mkdir build && cd build + export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig" + cmake -G Xcode -Denable-sdl2=0 -Denable-readline=0 -Denable-dbus=0 .. + xcodebuild + displayName: 'Test CMake XCode Generator' + condition: and(succeeded(), not(contains(variables.CMakeFlags, 'Denable-framework=0'))) - job: macOS_ports diff --git a/.azure/azure-pipelines-vcpkg.yml b/.azure/azure-pipelines-vcpkg.yml index 3918115b5..52e3cafb8 100644 --- a/.azure/azure-pipelines-vcpkg.yml +++ b/.azure/azure-pipelines-vcpkg.yml @@ -34,7 +34,7 @@ variables: toolset: 'v142' generator: 'Visual Studio 16 2019' configuration: 'RelWithDebInfo' - VCPKG_REVISION: 'acc3bcf76b84ae5041c86ab55fe138ae7b8255c7' + VCPKG_REVISION: 'fc59c2a30a99536e8fb6e085c228e9f724dd87d0' jobs: - job: vcpkg diff --git a/.cirrus.yml b/.cirrus.yml index 183282b9e..99bbd6c44 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ task: freebsd_instance: matrix: image_family: freebsd-13-2 - image_family: freebsd-13-1 + image_family: freebsd-12-4 install_script: pwd && ls -la && pkg update --force && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 2b95d072d..b2ae8868d 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -17,6 +17,7 @@ env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Use Debug build for better code coverage results BUILD_TYPE: Debug + BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed name: SonarCloud Workflow jobs: @@ -60,20 +61,23 @@ jobs: shell: bash working-directory: ${{github.workspace}}/build run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE + + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v2 - name: Build working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | - ./build-wrapper-linux-x86-64 --out-dir bw-output make + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make - name: Test working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. run: | - ./build-wrapper-linux-x86-64 --out-dir bw-output make coverage + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make coverage # sonar-scanner does not like utf8 filenames - name: Prepare for Sonar @@ -85,19 +89,11 @@ jobs: ls -la ${{ github.workspace }}/build ls -la ${{ github.workspace }}/build/coverage -# The official sonarsource/sonarcloud-github-action@v1.5 action does not work properly. -# It keeps complaining that the build-wrapper.json cannot be found. -# Hence, use a third party action to download and add sonar-scanner to PATH and then run it manually. - - name: Setup sonarqube - uses: warchant/setup-sonar-scanner@v3 - - - name: Run sonarqube + - name: Run sonar-scanner env: - # to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: sonar-scanner - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.cfamily.build-wrapper-output=${{ github.workspace }}/build/bw-output - -Dsonar.coverageReportPaths=build/coverage/sonarqube.report - -Dsonar.verbose=false - -Dsonar.host.url=https://sonarcloud.io/ + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + sonar-scanner \ + -Dsonar.cfamily.build-wrapper-output="${{github.workspace}}/build/${{ env.BUILD_WRAPPER_OUT_DIR }}" \ + -Dsonar.coverageReportPaths=${{github.workspace}}/build/coverage/sonarqube.report diff --git a/CMakeLists.txt b/CMakeLists.txt index 704d18fe9..986b59419 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -547,7 +547,7 @@ endif ( enable-libsndfile ) unset ( PULSE_SUPPORT CACHE ) if ( enable-pulseaudio ) - find_package ( PulseAudio ${PULSEAUDIO_MINIMUM_VERSION} QUIET ) + find_package ( PulseAudio ${PULSEAUDIO_MINIMUM_VERSION} ) # Upstream config does not search for pulse-simple find_library ( PULSEAUDIO_SIMPLE_LIBRARY NAMES "pulse-simple" ) if ( PULSEAUDIO_FOUND AND PULSEAUDIO_SIMPLE_LIBRARY ) diff --git a/sonar-project.properties b/sonar-project.properties index c1d7eb142..603bc9bad 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,8 +1,7 @@ sonar.projectKey=FluidSynth_fluidsynth sonar.organization=fluidsynth -sonar.cfamily.threads=4 -sonar.cfamily.cache.enabled=false +sonar.cfamily.threads=2 # This is the name and version displayed in the SonarCloud UI. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 114fa1632..0b1566c21 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -360,7 +360,8 @@ if ( TARGET SndFile::sndfile AND LIBSNDFILE_SUPPORT ) endif() if ( PULSE_SUPPORT ) - target_include_directories( libfluidsynth-OBJ PRIVATE ${PULSEAUDIO_INCLUDE_DIRS} ) + # need to include PULSEAUDIO_INCLUDE_DIR to make it compile with homebrew on Mac + target_include_directories( libfluidsynth-OBJ PRIVATE ${PULSEAUDIO_INCLUDE_DIRS} ${PULSEAUDIO_INCLUDE_DIR} ) target_link_libraries ( libfluidsynth-OBJ PUBLIC ${PULSEAUDIO_LIBRARIES} ) endif()