-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Msvc/vst-rebase : msvc support #4352
Conversation
+locale: using path instead of individual files to reduce command line size +remotevstplugin: changed order return type & calling convention (compiler error) +lmmsobj: removed single quotes for command line defines
+added toolchain file +added toolset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two changes left to do to fix Linux compilation:
- In
plugins/carlabase/carla.h
, a#include "plugin_export.h"
is missing - In
cmake/linux/package_linux.sh.in
,RemoteVstPlugin.exe.so
needs to be changedRemoteVstPlugin32.exe.so
Could you add these to your PR?
plugins/vst_base/CMakeLists.txt
Outdated
@@ -27,33 +27,27 @@ SET(EXTERNALPROJECT_CMAKE_ARGS | |||
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" | |||
"-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}" | |||
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" | |||
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be moved to the MSVC
-specific part. It conflicts with the toolchain file passed in line 70.
src/core/audio/AudioSdl.cpp
Outdated
@@ -64,14 +64,22 @@ AudioSdl::AudioSdl( bool & _success_ful, Mixer* _mixer ) : | |||
m_audioHandle.callback = sdlAudioCallback; | |||
m_audioHandle.userdata = this; | |||
|
|||
SDL_AudioSpec actual; | |||
|
|||
SDL_AudioSpec actual; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF(NOT SNDFILE_FOUND) | ||
MESSAGE(FATAL_ERROR "LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.18 - please install, remove CMakeCache.txt and try again!") | ||
ENDIF() | ||
IF(USING_VCPKG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd hide these details in a FindSndFile.cmake
script and only call FIND_PACKAGE(SndFile)
here, but I guess that's out of scope for this PR so it's fine this way for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
I'm a bit relaxed about coding standards because this is only a proof of concept. If it works, I'll implement those changes. If it doesn't, I'll look for other package managers in windows (scoop?) and see if I can implement those.
+carla: exports header +package_linux: corrected RemoteVstPlugin name +vstbase: toolchain file conditional on MSVC
I've added the changes you requested and got most of the tests to pass but I don't know why the travis continuous integration is failing. I can't reproduce that error on my machine. I removed the install of remotevstplugin64 because appimage was complaining about it. No idea if that's correct or not. |
It's now possible to create an NSIS installer package using msvc. edit: I just remembered that in the initial install of vcpkg they have to compile qt5. So.. um... let's say they can get it running easily instead of quickly :) |
@justnope Although we're trying to get away from the hard-coded install paths in CMake (see #4345), this is a great addition! Thanks! 👍 Thank you for your hard work on this! It's great to see the Windows platform get some attention. I'll go through the changes again and leave some comments about minor code-style issues. As far as I can see, |
plugins/vst_base/CMakeLists.txt
Outdated
# build 32 bit version of RemoteVstPlugin | ||
IF(LMMS_BUILD_WIN32 AND NOT LMMS_BUILD_WIN64) | ||
ADD_SUBDIRECTORY(RemoteVstPlugin) | ||
INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe" "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe" DESTINATION "${PLUGIN_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has ${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe
twice.
plugins/vst_base/CMakeLists.txt
Outdated
"-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}" | ||
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" | ||
) | ||
|
||
IF(MSVC) | ||
LIST(APPEND EXTERNALPROJECT_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is only used in the ELSEIF(LMMS_BUILD_WIN64 AND MSVC)
case, you can just move it down there, so that it reads from line 50:
ExternalProject_Add(RemoteVstPlugin32
"${EXTERNALPROJECT_ARGS}"
CMAKE_GENERATOR ${GENERATOR}
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
CMAKE_ARGS
"${EXTERNALPROJECT_CMAKE_ARGS}"
-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE}"
"-DCMAKE_PREFIX_PATH=${QT_32_PREFIX}"
)
plugins/vst_base/CMakeLists.txt
Outdated
CMAKE_ARGS | ||
"${EXTERNALPROJECT_CMAKE_ARGS}" | ||
"-DCMAKE_PREFIX_PATH=${QT_32_PREFIX}" | ||
) | ||
INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe" DESTINATION "${PLUGIN_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these redundant INSTALL
statements downwards after the ENDIF()
? Something like this:
IF(TARGET RemoteVstPlugin32)
IF(LMMS_BUILD_LINUX)
INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32" "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe.so" DESTINATION "${PLUGIN_DIR}")
ELSEIF(LMMS_BUILD_WIN32)
INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe" DESTINATION "${PLUGIN_DIR}")
ENDIF()
ENDIF()
I've tested msvc 2015 & 2017/32 & 64 bits. It all seems to work after implementing your code review suggestions (thanks btw). It's definitely not finished as in merge into the master branch, but I think it should be safe enough to merge into msvc/vst-rebase. TODO: |
Why close this @justnope? Didn't have time to merge yet. |
I've made another branch from this branch msvc/ng. Last time I did this the things I pushed in the new branch also ended up in the PR which wasn't the intention. I might have screwed up the git commands when that happened, but in any case if you see extra commits they are from the new branch. |
@justnope Only commits you push to this branch will end up in the PR. I'll merge shortly. 👍 |
@@ -7,8 +7,10 @@ | |||
#include <memory> | |||
#include <utility> | |||
|
|||
#if (__cplusplus >= 201402L) | |||
#if (__cplusplus >= 201402L || _MSC_VER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS 2012(_MSC_VER == 1700
) doesn't have std::make_unique
while 2013 (_MSC_VER == 1800
) has. This will cause compile errors when using VS 2012.
* locale: using path instead of individual files to reduce command line size * remotevstplugin: changed order return type & calling convention (compiler error) * lmmsobj: removed single quotes for command line defines * added vcpkg support & std::make_unique for MSVC * carla: include exports header * package_linux: corrected RemoteVstPlugin name * vstbase: toolchain file conditional on MSVC * Added install for remotevstplugin * msvc: installer works with vcpkg Remotevst 64bit install removed due to an ApImage problem
* locale: using path instead of individual files to reduce command line size * remotevstplugin: changed order return type & calling convention (compiler error) * lmmsobj: removed single quotes for command line defines * added vcpkg support & std::make_unique for MSVC * carla: include exports header * package_linux: corrected RemoteVstPlugin name * vstbase: toolchain file conditional on MSVC * Added install for remotevstplugin * msvc: installer works with vcpkg Remotevst 64bit install removed due to an ApImage problem
* locale: using path instead of individual files to reduce command line size * remotevstplugin: changed order return type & calling convention (compiler error) * lmmsobj: removed single quotes for command line defines * added vcpkg support & std::make_unique for MSVC * carla: include exports header * package_linux: corrected RemoteVstPlugin name * vstbase: toolchain file conditional on MSVC * Added install for remotevstplugin * msvc: installer works with vcpkg Remotevst 64bit install removed due to an ApImage problem
Here's some proposed changes to compile using MSVC. I think using vcpkg would be ideal since it has built in support for cmake (find_package where supported). And as an added bonus it's also works on linux (although I don't see a reason for using it there)
It obviously needs more testing, but this isn't the master branch so I think we're ok.
using vcpkg
install
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
installing libs 4 lmms
.\vcpkg.exe install fftw3 libsndfile libsamplerate qt5
cmake usage
cmake "-DCMAKE_TOOLCHAIN_FILE=<vcpkgdir>/scripts/buildsystems/vcpkg.cmake" <lmms src dir>