-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix MSVC VST compilation #4421
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
Closed
Fix MSVC VST compilation #4421
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
884601f
Use CMake GenerateExportHeader
lukas-w 74d4b2f
CMake: Fix MSVC architecture detection
lukas-w 81a0ec3
MSVC: Port RemoteVstPlugin
lukas-w c41d59b
RemoteVstPlugin: Debug LoadLibrary failure
lukas-w 2b1b3d3
MSVC: Fix VST build
lukas-w b416036
VST: Fix main entry calling convention
lukas-w 9c35487
Linux compile fixes
lukas-w c3d0dc5
Fix Linux VST compilation
lukas-w e95a587
MSVC: Fix VST arch detection
lukas-w e644202
MSVC: Fix RemoteVstPlugin module path
lukas-w 8fce500
VST build fixes
lukas-w f702738
CMake quoting fixes
lukas-w 5b9579d
MinGW fixes
lukas-w 9a9580a
Fix export errors with MinGW
lukas-w a0bd296
Mingw64 compilation fixes
lukas-w 39d83ee
More export fixes
lukas-w be0c02f
Fix 64bit VSTs on Linux by fixing callback calling convention
lukas-w 5744c2a
CMake: Fix Clang detection
lukas-w 3beac2c
MSVC fixes (#4352)
9db8cbf
Enable 64bit VSTs on Linux
lukas-w cd35ec2
MSVC VST compilation fixes
lukas-w 225e902
AudioSdl: Add support for full SDL2 with float samples and recording
Reflexe aa2c867
AudioSDL -> SDL2: Fix a crash from calling a SDL1 function instead of
Reflexe 3d98b0a
Fix cherry-pick
lukas-w ad4c4f0
AudioSdl: Use NULL for device names in order to get the default device.
lukas-w 00fda3f
Fix AppImage VST
lukas-w 4d5eb7f
CircleCI: Display Appimage log when failing
lukas-w 0349b97
Fix AppImage 64bit RemoteVstPlugin libwine discovery
lukas-w af57300
VstPlugin: Fix define naming conflict with MinGW
lukas-w 57fdaed
winegcc_wrapper: Remove misleading usage hint
lukas-w 40a1e36
RemotePlugin: Revert unnecessary invalidate() changes
lukas-w 642703e
Whitespace fix
lukas-w 66c2047
CircleCI: Make sure build fails when AppImage building does
lukas-w 65ccaff
RemoteVstPlugin: Fix confusing variable names
lukas-w d04965a
Merge branch 'master' into msvc/vst
lukas-w File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
MSVC VST compilation fixes
- Loading branch information
commit cd35ec2d587ed464d0edd0f17c43cb43fe604955
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| IF(LMMS_BUILD_WIN32 AND NOT LMMS_BUILD_WIN64) | ||
| ADD_SUBDIRECTORY(RemoteVstPlugin) | ||
| ELSEIF(LMMS_BUILD_WIN64 AND MSVC) | ||
| SET(MSVC_VER ${CMAKE_CXX_COMPILER_VERSION}) | ||
|
|
||
| IF(NOT CMAKE_GENERATOR_32) | ||
| IF(MSVC_VER VERSION_GREATER 19.0 OR MSVC_VER VERSION_EQUAL 19.0) | ||
| SET(CMAKE_GENERATOR_32 "Visual Studio 14 2015") | ||
| SET(MSVC_YEAR 2015) | ||
| ELSEIF(MSVC_VER VERSION_EQUAL 19.10 OR MSVC_VER VERSION_EQUAL 19.10) | ||
| SET(CMAKE_GENERATOR_32 "Visual Studio 15 2017") | ||
| SET(MSVC_YEAR 2017) | ||
| ELSE() | ||
| MESSAGE(SEND_WARNING "Can't build RemoteVstPlugin32, unknown MSVC version ${MSVC_VER} and no CMAKE_GENERATOR_32 set") | ||
| RETURN() | ||
| ENDIF() | ||
| ENDIF() | ||
|
|
||
| IF(NOT QT_32_PREFIX AND NOT USING_VCPKG) | ||
| GET_FILENAME_COMPONENT(QT_BIN_DIR ${QT_QMAKE_EXECUTABLE} DIRECTORY) | ||
| SET(QT_32_PREFIX "${QT_BIN_DIR}/../../msvc${MSVC_YEAR}") | ||
| ENDIF() | ||
|
|
||
| IF(NOT QT_32_PREFIX) | ||
| MESSAGE(WARNING "Can't build RemoteVstPlugin32, QT_32_PREFIX not set") | ||
| RETURN() | ||
| ELSEIF(NOT (IS_DIRECTORY ${QT_32_PREFIX} AND EXISTS ${QT_32_PREFIX}/bin/qmake.exe)) | ||
| MESSAGE(WARNING "Can't build RemoteVstPlugin32, no Qt 32 bit installation found at ${QT_32_PREFIX}") | ||
| RETURN() | ||
| ENDIF() | ||
|
|
||
| ExternalProject_Add(RemoteVstPlugin32 | ||
| "${EXTERNALPROJECT_ARGS}" | ||
| CMAKE_GENERATOR "${CMAKE_GENERATOR_32}" | ||
| #CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}" | ||
| CMAKE_ARGS | ||
| "${EXTERNALPROJECT_CMAKE_ARGS}" | ||
| "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" | ||
| "-DCMAKE_PREFIX_PATH=${QT_32_PREFIX}" | ||
| ) | ||
| ELSEIF(LMMS_BUILD_LINUX) | ||
| # Use winegcc | ||
| ExternalProject_Add(RemoteVstPlugin32 | ||
| "${EXTERNALPROJECT_ARGS}" | ||
| CMAKE_ARGS | ||
| "${EXTERNALPROJECT_CMAKE_ARGS}" | ||
| "-DCMAKE_CXX_COMPILER=${WINEGCC}" | ||
| "-DCMAKE_CXX_FLAGS=-m32 -mwindows" | ||
| ) | ||
| ELSEIF(CMAKE_TOOLCHAIN_FILE_32) | ||
| ExternalProject_Add(RemoteVstPlugin32 | ||
| "${EXTERNALPROJECT_ARGS}" | ||
| CMAKE_ARGS | ||
| "${EXTERNALPROJECT_CMAKE_ARGS}" | ||
| "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_32}" | ||
| "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE_32}" | ||
| ) | ||
| ELSE() | ||
| message(WARNING "Can't build RemoteVstPlugin32, unknown environment. Please supply CMAKE_TOOLCHAIN_FILE_32 and optionally CMAKE_PREFIX_PATH_32") | ||
| RETURN() | ||
| ENDIF() | ||
|
|
||
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| IF(LMMS_BUILD_WIN64) | ||
| ADD_SUBDIRECTORY(RemoteVstPlugin) | ||
| INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin64.exe" DESTINATION "${PLUGIN_DIR}") | ||
| ELSEIF(LMMS_BUILD_LINUX) | ||
| ExternalProject_Add(RemoteVstPlugin64 | ||
| "${EXTERNALPROJECT_ARGS}" | ||
| CMAKE_ARGS | ||
| "${EXTERNALPROJECT_CMAKE_ARGS}" | ||
| "-DCMAKE_CXX_COMPILER=${WINEGCC}" | ||
| "-DCMAKE_CXX_FLAGS=-m64 -mwindows" | ||
| ) | ||
| INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin64" "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin64.exe.so" DESTINATION "${PLUGIN_DIR}") | ||
| ENDIF() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 I understand correctly, this will try to load 64bit DLL in 32bit system using nonexistent
RemoteVstPlugin64. It will print an error message, but Windows users can't see that.Do we need to try this on 32bit LMMS?
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 is correct, there's no visible error message in the GUI when loading fails. This PR doesn't change that.
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 think error message issue can be fixed later, but do we ever need to try to load VST with
RemoteVstPlugin64on 32bit systems?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.
Theoretically, we could ship a
RemoteVstPlugin64with our 32bit Windows installers for users who install 32bit LMMS because they're unaware of the difference. In that case, it's good to tryRemoteVstPlugin64. In any other case, there's no harm done here.tryLoadwill discover thatRemoteVstPlugin64doesn't exist and will abort, at which point we can easily add an error message later.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.
Got it, I didn't think about that.
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 think we may try to detect processor in runtime if possible, though it looks like out of scope.
Qt provides
QSysInfo::currentCpuArchitectureas of Qt 5.4, and it's also possible to use OS-dependent detection.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 opened #4447 to track it.