diff --git a/.appveyor.yml b/.appveyor.yml index 4fc03c7c..f240feb4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,8 +1,8 @@ version: '{build}' image: - - Visual Studio 2013 - Visual Studio 2017 - Visual Studio 2019 + - Visual Studio 2022 platform: - Win32 @@ -14,7 +14,7 @@ cache: install: - ps: | if (-Not (Test-Path "C:\tmp\VST3 SDK")) { - Invoke-WebRequest "https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip" + Invoke-WebRequest "https://web.archive.org/web/20200502121517if_/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip" Expand-Archive "vstsdk.zip" "C:\tmp" } @@ -22,7 +22,7 @@ build_script: # build native code/tests - mkdir build - cd build - - cmake -DCMAKE_GENERATOR_PLATFORM=%PLATFORM% -DVSTSDK3_DIR="C:/tmp/VST3 SDK" .. + - cmake -DCMAKE_GENERATOR_PLATFORM=%PLATFORM% -DVSTSDK3_DIR="C:/tmp/VST3 SDK" -DDOWNLOAD_MONAD_FL_PARSER=ON -DMONAD_FL_PARSER_DIR="C:/tmp/Monad.FLParser" .. - msbuild /v:minimal /nologo WaveSabre.sln - msbuild /v:minimal /nologo /property:Configuration="MinSizeRel" WaveSabre.sln - cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ff58de4..db4e82ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,12 @@ project("WaveSabre" LANGUAGES C CXX CSharp) # Enable C# Utilities also for the VS2013 AppVeyor stage. cmake_policy(SET CMP0057 NEW) include(CSharpUtilities) -set(CMAKE_CSharp_FLAGS ${CMAKE_CSharp_FLAGS} "/langversion:6") + +# Note: The space suffix is required for the flag to work correctly. +set(CMAKE_CSharp_FLAGS "/langversion:latest ") + +find_package(Git REQUIRED) +include(ExternalProject) cmake_minimum_required(VERSION 3.11) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -18,7 +23,8 @@ set(BUILD_WAVESABRE_CONVERT ON CACHE BOOL "Do not build WaveSabreConvert.") set(BUILD_WAVESABRE_CONVERT_TESTS ON CACHE BOOL "Do not build the WaveSabreConvert tests.") set(BUILD_CONVERT_THE_FUCK ON CACHE BOOL "Do not build ConvertTheFuck.") set(BUILD_PROJECT_MANAGER ON CACHE BOOL "Do not build the project manager.") -set(VSTSDK3_DIR "${PROJECT_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location") +set(VSTSDK3_DIR "${PROJECT_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location.") +set(MONAD_FL_PARSER_DIR "${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser.Source" CACHE PATH "Monad FL parser location.") # Download and unpack VST3 SDK set(DOWNLOAD_VST3SDK OFF CACHE BOOL "Download and unpack VST3 SDK automatically.") @@ -33,6 +39,29 @@ if(${BUILD_VST_PLUGINS} AND ${DOWNLOAD_VST3SDK}) endif() endif() +# Download and unpack the Monad FL Parser +set(DOWNLOAD_MONAD_FL_PARSER OFF CACHE BOOL "Download the Monad FL parser binary automatically.") +if(${BUILD_WAVESABRE_CONVERT} AND ${DOWNLOAD_MONAD_FL_PARSER}) + set(MONAD_FL_PARSER_BINARY ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser/Release/Monad.FLParser.dll) + find_file(MONAD_FL_PARSER_TEST NAME Project.cs HINTS ${MONAD_FL_PARSER_DIR}) + if(${MONAD_FL_PARSER_TEST} MATCHES MONAD_FL_PARSER_TEST-NOTFOUND) + message(STATUS "Monad FL parser not found. Will download.") + ExternalProject_Add(FLParser + SOURCE_DIR ${MONAD_FL_PARSER_DIR} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser + GIT_REPOSITORY https://github.com/Kwarf/FLParser.git + GIT_TAG c9b0bc5 + CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} ${PROJECT_SOURCE_DIR}/WaveSabreConvert/FLParser -DMONAD_FL_PARSER_DIR=${MONAD_FL_PARSER_DIR} + BUILD_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser --config Release -- -m + INSTALL_COMMAND "" + ) + endif() +elseif(${BUILD_WAVESABRE_CONVERT}) + message(STATUS "Using existent FL parser repo.") + add_subdirectory(WaveSabreConvert/FLParser) + set(MONAD_FL_PARSER_BINARY ${CMAKE_CURRENT_BINARY_DIR}/WaveSabreConvert/FLParser/Release/Monad.FLParser.dll) +endif() + # shared code add_subdirectory(MSVCRT) add_subdirectory(WaveSabreCore) diff --git a/Docs/Home.md b/Docs/Home.md index 94c9980a..38d920a5 100644 --- a/Docs/Home.md +++ b/Docs/Home.md @@ -4,6 +4,7 @@ - WaveSabre builds have only been tested with Visual Studio 2013/2015/2017/2019 and version 3.6.6 of the VST3 SDK. - Due to licensing requirements, WaveSabre requires you to either [download](https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip) and copy the VST3 SDK into the build yourself. Download, extract, and copy into the *"Vst3.x"* folder. See [this readme](https://github.com/logicomacorp/WaveSabre/blob/master/Vst3.x/README) or download the VST3 SDK automatically using CMake (see below). +- For the same reasons, you should [download](https://github.com/Kwarf/FLParser) the Monad FL parser source yourself. You can also let CMake download the Monad FL parser automatically for you; see below for the command line options to use for this. ### CMake @@ -15,6 +16,8 @@ WaveSabre has a new [CMake](https://cmake.org/) based build-system that can gene - Run `cmake -B build` to generate the Visual Studio project files and solution - Optionally, you can also specify `-DVSTDIR=` to copy the VST plugins into your DAW's VST plugin directory upon build. - Optionally, you can specify `-DDOWNLOAD_VST3SDK=ON` to let CMake download and unpack the VST3 SDK for you. + - Optionally, you can specify `-DDOWNLOAD_MONAD_FL_PARSER=ON` to let CMake download and unpack the Monad FL parser for you. + - It is possible to specify a custom directory for the Monad FL parser using `-DMONAD_FL_PARSER_DIR=`. - You can specify `-DBUILD_VST_PLUGINS=OFF` to avoid building the plugins (useful for projects that only need the synthesizer and not the plugins). - You can also specify `-DVSTSDK3_DIR=` to use a VSTSDK from outside of the source-tree. - You can limit the tools you want to build by using `-DBUILD_WAVESABRE_CONVERT=OFF`, `-DBUILD_WAVESABRE_CONVERT_TESTS=OFF`, `-DBUILD_CONVERT_THE_FUCK=OFF` or `-DBUILD_PROJECT_MANAGER=OFF`. diff --git a/WaveSabreConvert/CMakeLists.txt b/WaveSabreConvert/CMakeLists.txt index 4daecae0..e6ec1666 100644 --- a/WaveSabreConvert/CMakeLists.txt +++ b/WaveSabreConvert/CMakeLists.txt @@ -31,10 +31,15 @@ set(WAVESABRE_CONVERT_SOURCES ) add_library(WaveSabreConvert SHARED ${WAVESABRE_CONVERT_SOURCES}) +set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${MONAD_FL_PARSER_BINARY}") +if(${DOWNLOAD_MONAD_FL_PARSER}) + add_dependencies(WaveSabreConvert FLParser) +else() + add_dependencies(WaveSabreConvert Monad.FLParser) +endif() csharp_set_designer_cs_properties(${WAVESABRE_CONVERT_SOURCES}) csharp_set_windows_forms_properties(${WAVESABRE_CONVERT_SOURCES}) -set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${CMAKE_CURRENT_SOURCE_DIR}/FLParser/Monad.FLParser.dll") set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1") set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCES "System" diff --git a/WaveSabreConvert/FLParser/CMakeLists.txt b/WaveSabreConvert/FLParser/CMakeLists.txt new file mode 100644 index 00000000..1ac199b4 --- /dev/null +++ b/WaveSabreConvert/FLParser/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.11) + +project(Monad.FLParser LANGUAGES CSharp) + +cmake_policy(SET CMP0057 NEW) +include(CSharpUtilities) + +# Note: The space suffix is required for the flag to work correctly. +set(CMAKE_CSharp_FLAGS "/langversion:latest ") + +set(MONAD_FL_PARSER_SOURCES + ${MONAD_FL_PARSER_DIR}/Properties/AssemblyInfo.cs + + ${MONAD_FL_PARSER_DIR}/AutomationData.cs + ${MONAD_FL_PARSER_DIR}/AutomationKeyframe.cs + ${MONAD_FL_PARSER_DIR}/Channel.cs + ${MONAD_FL_PARSER_DIR}/ChannelPlaylistItem.cs + ${MONAD_FL_PARSER_DIR}/Enums.cs + ${MONAD_FL_PARSER_DIR}/FlParseException.cs + ${MONAD_FL_PARSER_DIR}/GeneratorData.cs + ${MONAD_FL_PARSER_DIR}/IChannelData.cs + ${MONAD_FL_PARSER_DIR}/Insert.cs + ${MONAD_FL_PARSER_DIR}/InsertSlot.cs + ${MONAD_FL_PARSER_DIR}/IPlaylistItem.cs + ${MONAD_FL_PARSER_DIR}/Note.cs + ${MONAD_FL_PARSER_DIR}/Pattern.cs + ${MONAD_FL_PARSER_DIR}/PatternPlaylistItem.cs + ${MONAD_FL_PARSER_DIR}/Plugin.cs + ${MONAD_FL_PARSER_DIR}/PluginIoInfo.cs + ${MONAD_FL_PARSER_DIR}/Project.cs + ${MONAD_FL_PARSER_DIR}/ProjectParser.cs + ${MONAD_FL_PARSER_DIR}/Track.cs +) + +add_library(Monad.FLParser SHARED ${MONAD_FL_PARSER_SOURCES}) +set_property(TARGET Monad.FLParser PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1") +set_property(TARGET Monad.FLParser PROPERTY VS_DOTNET_REFERENCES + "System" + "System.Core" +) diff --git a/WaveSabreConvert/FLParser/LICENSE b/WaveSabreConvert/FLParser/LICENSE deleted file mode 100644 index cce5f68d..00000000 --- a/WaveSabreConvert/FLParser/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2017 MONAD Demogroup - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/WaveSabreConvert/FLParser/Monad.FLParser.dll b/WaveSabreConvert/FLParser/Monad.FLParser.dll deleted file mode 100644 index f00a6f84..00000000 Binary files a/WaveSabreConvert/FLParser/Monad.FLParser.dll and /dev/null differ