From 9f9618c465eddc5d392dd0605f4f3c7c74d8fda6 Mon Sep 17 00:00:00 2001 From: Thor Harald Johansen Date: Tue, 11 Apr 2023 10:52:36 +0200 Subject: [PATCH] Patches for Windows/MSVC compatibility --- .gitignore | 1 + CMakeLists.txt | 1 + src/synthapp.cpp | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6e90488..c54b24c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build/ .DS_Store CMakeCache.txt CMakeFiles/ +Launch_main_*/ *.cmake main Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt index c08ee85..803df54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ set(BUILD_SHARED_LIBS OFF) if(WIN32) option(PA_USE_ASIO "" ON) option(PA_USE_WDMKS "" OFF) + option(PA_USE_WDMKS_DEVICE_INFO "" OFF) endif() add_subdirectory(lib/portaudio) add_subdirectory(lib/portmidi) diff --git a/src/synthapp.cpp b/src/synthapp.cpp index 88b1f9c..fad60db 100644 --- a/src/synthapp.cpp +++ b/src/synthapp.cpp @@ -202,4 +202,12 @@ int SynthApp::OnExit() { return 0; } -wxIMPLEMENT_APP(SynthApp); \ No newline at end of file +wxIMPLEMENT_APP(SynthApp); + +#ifdef WIN32 +int main(int argc, char** argv) { + HMODULE module = GetModuleHandle(NULL); + LPSTR lpCmdLine = (LPSTR) calloc(1, 1); + return WinMain(module, NULL, lpCmdLine, SW_SHOW); +} +#endif \ No newline at end of file