Skip to content

Commit

Permalink
Merge edf317d into df8557c
Browse files Browse the repository at this point in the history
  • Loading branch information
stekyne committed Aug 18, 2021
2 parents df8557c + edf317d commit 068aa89
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 35 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Expand Up @@ -7,6 +7,5 @@ end_of_line = lf
indent_style = space
indent_size = 4

#[*.{py,h,hh,hpp,c,cc,cpp}]
#indent_style = space
#indent_size = 4
[*.yml]
indent_size = 2
107 changes: 94 additions & 13 deletions .github/workflows/csound_builds.yml
@@ -1,47 +1,56 @@
name: csound_builds

on:
env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
CSOUND_VERSION: 6.17.0
CSOUND_MANUAL_VERSION: 6.16.0

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
pull_request:
branches:
- develop

jobs:
linux_build:
name: Linux/Ubuntu build
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v1
with:
with:
fetch-depth: 1
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install cmake libsndfile1-dev libasound2-dev libjack-dev portaudio19-dev libportmidi-dev libpulse-dev swig liblua5.1-0-dev default-jdk libfltk1.1-dev libfluidsynth-dev liblo-dev fluid ladspa-sdk libpng-dev dssi-dev libstk0-dev libgmm++-dev bison flex libportsmf-dev libeigen3-dev libcunit1-dev
run: sudo apt-get update && sudo apt-get install cmake libsndfile1-dev libasound2-dev libjack-dev portaudio19-dev libportmidi-dev libpulse-dev swig liblua5.1-0-dev default-jdk libfltk1.1-dev libfluidsynth-dev liblo-dev fluid ladspa-sdk libpng-dev dssi-dev libstk0-dev libgmm++-dev bison flex libportsmf-dev libeigen3-dev libcunit1-dev
- name: Configure build
run: mkdir build && cd build && cmake ..
- name: Build Csound
run: cd build && make
- name: Build Csound
run: cd build && make
- name: Run tests
run: cd build && make test csdtests

macos_build:
name: MacOS build
runs-on: macos-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v1
with:
with:
fetch-depth: 1
- name: Install Dependencies
run: brew install cmake swig eigen asio libsndfile portaudio portmidi libsamplerate liblo jack openjdk hdf5 gettext fluid-synth fltk stk wiiuse
- name: Configure build
run: mkdir build && cd build && cmake ..
- name: Build Csound
run: cd build && make
- name: Build Csound
run: cd build && make
- name: Run tests
run: cd build && make test csdtests

emscripten_build:
name: EMscripten build
runs-on: ubuntu-latest
steps:
- name: run the Docker image
Expand All @@ -52,7 +61,9 @@ jobs:
with:
name: csound-web-6.17.0.zip
path: .

android_build:
name: Android build
runs-on: ubuntu-latest
steps:
- name: run the Docker image
Expand All @@ -61,5 +72,75 @@ jobs:
run: docker cp csound_test_run:/csound/Android/csound-android-6.17.0.zip .
- uses: actions/upload-artifact@v2
with:
name: csound-android-6.17.0.zip
name: csound-android-6.17.0.zip
path: .

windows_build:
name: Windows build
runs-on: windows-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v1
with:
fetch-depth: 1
submodules: true
- name: Install system dependencies
run: |
choco install swig -y --version=4.0.1 --allow-downgrade
choco install winflexbison -y
- name: Bootstrap VCPKG
run: .\vcpkg\bootstrap-vcpkg.bat
- name: Setup NuGet Credentials
shell: bash
run: >
`./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/csound/index.json"
-storepasswordincleartext
-name "GitHub"
-username "csound"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure build
run: cmake -B build -S . -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/windows/Custom-vs.cmake"
- name: Build Csound
run: cmake --build build
- name: Run tests
run: cmake --build build --target csdtests
- name: Acquire Csound manual
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
branch: master
name: Csound6.16.0_manual_html.zip
path: C:/
repo: https://github.com/csound/manual
- name: Build installer
run: |
iscc /dVcpkgInstallDir=%VCPKGDir%\\installed\\x64-windows-csound /omsvc installer\\windows\\csound6_x64_appveyor.iss
7z a csound-windows_x86_64-${{env.CSOUND_VERSION}}-${{env.GITHUB_RUN_ID}}.zip %GITHUB_WORKSPACE%\msvc\csound-vs\Release\*.exe %GITHUB_WORKSPACE%\msvc\csound-vs\Release\csound64.lib %GITHUB_WORKSPACE%\include\ %GITHUB_WORKSPACE%\msvc\csound-vs\Release\*.dll %GITHUB_WORKSPACE%\msvc\csound-vs\Release\*.pyd %GITHUB_WORKSPACE%\msvc\csound-vs\*.jar %GITHUB_WORKSPACE%\msvc\csound-vs\*.py
7z l csound-windows_x86_64-${{env.CSOUND_VERSION}}-${{env.GITHUB_RUN_ID}}.zip
# jobs:
# build:
# strategy:
# matrix:
# include:
# - name: Linux (Ubuntu latest)
# os: ubuntu-latest
# # install_dir: ~/libKeyFinder
# # cmake_extras: -DCMAKE_BUILD_TYPE=RelWithDebInfo

# - name: macOS (latest)
# os: macos-latest
# # install_dir: ~/libKeyFinder
# # cmake_extras: -DCMAKE_BUILD_TYPE=RelWithDebInfo

# - name: Windows (latest)
# os: windows-latest
# install_dir: C:\libKeyFinder
# cmake_extras: >-
# -DVCPKG_TARGET_TRIPLET=x64-windows-static
# -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
# cmake_config: --config RelWithDebInfo
# ctest_config: --build-config RelWithDebInfo

3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg.git
38 changes: 29 additions & 9 deletions CMakeLists.txt
@@ -1,14 +1,36 @@
cmake_minimum_required(VERSION 3.5)

# silence RPATH cmake warning
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

option(USE_VCPKG "Use VCPKG to download and manage dependencies" OFF)

if (USE_VCPKG)
# Detect correct triplet based on CMake env
if (WIN32)
set(VCPKG_TARGET_TRIPLET "x64-windows-csound")
elseif(APPLE)
set(VCPKG_TARGET_TRIPLET "x64-osx")
elseif (UNIX)
set(VCPKG_TARGET_TRIPLET "x64-linux")
endif()

set(VCPKG_FEATURE_FLAGS versions)
set(VCPKG_OVERLAY_TRIPLETS ${CMAKE_CURRENT_SOURCE_DIR}/platform/triplets)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")
endif()

message(STATUS "VCPKG_TARGET_TRIPLET: ${VCPKG_TARGET_TRIPLET}")
message(STATUS "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}")

project(Csound)

ENABLE_TESTING()

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_COMPILER_IS_CLANG 1)
set(CMAKE_COMPILER_IS_CLANG 1)
endif()

message(STATUS "Csound directory: ${CMAKE_HOME_DIRECTORY}")
Expand All @@ -23,13 +45,11 @@ set(APIVERSION "6.0")

# Relative install paths
set(EXECUTABLE_INSTALL_DIR "bin")

set(LOCALE_INSTALL_DIR "share/locale")
set(HEADER_INSTALL_DIR "include/csound")

set(SAMPLES_INSTALL_DIR "/samples")

set(CS_FRAMEWORK_DEST "~/Library/Frameworks" CACHE PATH "Csound framework path")

include(TestBigEndian)
include(CheckFunctionExists)
include(CheckIncludeFile)
Expand Down Expand Up @@ -210,7 +230,7 @@ else()
set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}")
endif()

if(APPLE)
if(APPLE)
get_filename_component(JAVA_MODULE_INSTALL_DIR_DEFAULT "~/Library/Java/Extensions" ABSOLUTE)
else()
set(JAVA_MODULE_INSTALL_DIR_DEFAULT ${LIBRARY_INSTALL_DIR})
Expand Down Expand Up @@ -240,7 +260,7 @@ if(WIN32)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_MODULE_PREFIX "")

set(CSOUND_WINDOWS_LIBRARIES
set(CSOUND_WINDOWS_LIBRARIES
advapi32
comctl32
comdlg32
Expand Down Expand Up @@ -791,7 +811,7 @@ set(libcsound_SRCS
Opcodes/afilters.c
Opcodes/wpfilters.c
Opcodes/zak.c
Opcodes/lufs.c
Opcodes/lufs.c
Top/argdecode.c
Top/csdebug.c
Top/cscore_internal.c
Expand Down Expand Up @@ -1124,7 +1144,7 @@ function(make_plugin libname srcs)
ARCHIVE_OUTPUT_DIRECTORY ${BUILD_PLUGINS_DIR})

install(TARGETS ${libname}
LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}"
LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}"
ARCHIVE DESTINATION "${PLUGIN_INSTALL_DIR}" )

endfunction(make_plugin)
Expand Down Expand Up @@ -1448,4 +1468,4 @@ else()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/samples
DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
endif()

2 changes: 1 addition & 1 deletion msvc/downloadDependencies.ps1
Expand Up @@ -87,7 +87,7 @@ if (-not (Test-Path $vcpkgDir/buildtrees/portaudio/src/asiosdk)) {

vcpkg --triplet $targetTriplet install `
eigen3 fltk zlib libflac libogg libvorbis libsndfile libsamplerate portmidi portaudio liblo hdf5 dirent libstk fluidsynth `
--overlay-triplets=.
--overlay-triplets=../platform/triplets

echo "Downloading and installing non-VCPKG packages..."

Expand Down
File renamed without changes.
9 changes: 0 additions & 9 deletions msvc/Custom-vs.cmake → platform/windows/Custom-vs.cmake
Expand Up @@ -71,14 +71,6 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_16BIT_TYPE "unsigned short")
set(FAIL_MISSING OFF) # Enable when packaging


# TEMPORARILY USE THE FOLLOWING SELF-BUILT PORTMIDI UNTIL VCPKG PROVIDES ONE
# THAT IS UP TO DATE
list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}\\msvc\\deps")
set(CMAKE_REQUIRED_INCLUDES ${PROJECT_SOURCE_DIR}\\msvc\\deps\\include)

# END CUSTOM PORTMIDI #

# Disable the following warnings in msvc
# - C4244 loss of data in conversion
# - C4267 loss of data in conversion
Expand All @@ -89,4 +81,3 @@ set(CMAKE_REQUIRED_INCLUDES ${PROJECT_SOURCE_DIR}\\msvc\\deps\\include)
# - C4477 format string type differences
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244 /wd4267 /wd4005 /wd4996 /wd4047 /wd4090 /wd4477")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244 /wd4267 /wd4005 /wd4996 /wd4047 /wd4090 /wd4477 /wd4251")

1 change: 1 addition & 0 deletions vcpkg
Submodule vcpkg added at 261c45
22 changes: 22 additions & 0 deletions vcpkg.json
@@ -0,0 +1,22 @@
{
"name": "csound",
"version-string": "6.16.2",
"builtin-baseline": "261c458af6e3eed5d099144aff95d2b5035f656b",
"dependencies": [
"eigen3",
"fltk",
"zlib",
"libflac",
"libogg",
"libvorbis",
"libsndfile",
"libsamplerate",
"portmidi",
"portaudio",
"liblo",
"hdf5",
"dirent",
"libstk",
"fluidsynth"
]
}

0 comments on commit 068aa89

Please sign in to comment.