From 8d9e0c13d6ce338259dbcfa3c3f103808669667e Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 15 Dec 2020 12:05:41 +0000 Subject: [PATCH] Make it no longer needed to do "make BUILDING_FOR_WINDOWS=true" --- Makefile | 12 ++++++++++-- data/windows/build-win.sh | 2 +- source/Makefile.mk | 4 ++-- source/bridges-plugin/CarlaBridgePlugin.cpp | 2 +- source/modules/water/water.files.cpp | 4 ++-- source/utils/CarlaBridgeUtils.cpp | 4 ++-- source/utils/CarlaPluginUI.cpp | 18 +++++++++--------- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 6a2efbb47..38f00cec6 100644 --- a/Makefile +++ b/Makefile @@ -339,10 +339,14 @@ LIBS_WIN32 += $(MODULEDIR)/juce_gui_extra.win32.a endif endif -win32: $(LIBS_WIN32) +win32r: $(LIBS_WIN32) $(MAKE) -C source/bridges-plugin win32 $(MAKE) -C source/discovery win32 +win32: $(LIBS_WIN32) + $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win32 + $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win32 + # --------------------------------------------------------------------------------------------------------------------- # Binaries (win64) @@ -368,10 +372,14 @@ LIBS_WIN64 += $(MODULEDIR)/juce_gui_extra.win64.a endif endif -win64: $(LIBS_WIN64) +win64r: $(LIBS_WIN64) $(MAKE) -C source/bridges-plugin win64 $(MAKE) -C source/discovery win64 +win64: $(LIBS_WIN64) + $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win64 + $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win64 + # --------------------------------------------------------------------------------------------------------------------- # Binaries (wine) diff --git a/data/windows/build-win.sh b/data/windows/build-win.sh index 332f3288f..4979210b5 100755 --- a/data/windows/build-win.sh +++ b/data/windows/build-win.sh @@ -90,7 +90,7 @@ make ${MAKE_ARGS} if [ x"${ARCH}" != x"32" ]; then export_vars "32" "32" "i686" - make ${MAKE_ARGS} win32 + make ${MAKE_ARGS} win32r fi # Testing: diff --git a/source/Makefile.mk b/source/Makefile.mk index eca7c99b7..78210e62d 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -184,8 +184,8 @@ ifeq ($(WIN32),true) BASE_OPTS += -fno-rerun-cse-after-loop # See https://github.com/falkTX/Carla/issues/855 BASE_OPTS += -mstackrealign -ifeq ($(BUILDING_FOR_WINDOWS),true) -BASE_FLAGS += -DBUILDING_CARLA_FOR_WINDOWS +ifeq ($(BUILDING_FOR_WINE),true) +BASE_FLAGS += -DBUILDING_CARLA_FOR_WINE endif else # Not needed for Windows diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index 2f9421973..8e428aa44 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -380,7 +380,7 @@ int main(int argc, char* argv[]) return 1; } -#if defined(CARLA_OS_WIN) && ! defined(BUILDING_CARLA_FOR_WINDOWS) +#if defined(CARLA_OS_WIN) && defined(BUILDING_CARLA_FOR_WINE) // --------------------------------------------------------------------- // Test if bridge is working diff --git a/source/modules/water/water.files.cpp b/source/modules/water/water.files.cpp index 7b364a31a..ff9bae7d7 100644 --- a/source/modules/water/water.files.cpp +++ b/source/modules/water/water.files.cpp @@ -1,7 +1,7 @@ /* * Cross-platform C++ library for Carla, based on Juce v4 * Copyright (C) 2015 ROLI Ltd. - * Copyright (C) 2017-2018 Filipe Coelho + * Copyright (C) 2017-2020 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -44,7 +44,7 @@ HINSTANCE getCurrentModuleInstanceHandle() noexcept #include "text/StringArray.cpp" #include "text/String.cpp" -#if defined(DEBUG) || defined(BUILDING_CARLA_FOR_WINDOWS) +#if defined(DEBUG) || !defined(BUILDING_CARLA_FOR_WINE) # include "files/FileInputStream.cpp" # include "files/FileOutputStream.cpp" # include "files/TemporaryFile.cpp" diff --git a/source/utils/CarlaBridgeUtils.cpp b/source/utils/CarlaBridgeUtils.cpp index 84b756c06..64abffb96 100644 --- a/source/utils/CarlaBridgeUtils.cpp +++ b/source/utils/CarlaBridgeUtils.cpp @@ -1,6 +1,6 @@ /* * Carla Bridge utils - * Copyright (C) 2013-2017 Filipe Coelho + * Copyright (C) 2013-2020 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -21,7 +21,7 @@ // must be last #include "jackbridge/JackBridge.hpp" -#if defined(CARLA_OS_WIN) && defined(BUILDING_CARLA_FOR_WINDOWS) +#if defined(CARLA_OS_WIN) && !defined(BUILDING_CARLA_FOR_WINE) # define PLUGIN_BRIDGE_NAMEPREFIX_AUDIO_POOL "Local\\carla-bridge_shm_ap_" # define PLUGIN_BRIDGE_NAMEPREFIX_RT_CLIENT "Local\\carla-bridge_shm_rtC_" # define PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_CLIENT "Local\\carla-bridge_shm_nonrtC_" diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 542ad4b41..919dec494 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin UI - * Copyright (C) 2014-2018 Filipe Coelho + * Copyright (C) 2014-2020 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -750,12 +750,12 @@ public: // winFlags |= WS_SIZEBOX; } -#ifdef BUILDING_CARLA_FOR_WINDOWS - const uint winType = WS_EX_TOOLWINDOW; - const HWND parent = (HWND)parentId; -#else +#ifdef BUILDING_CARLA_FOR_WINE const uint winType = WS_EX_DLGMODALFRAME; const HWND parent = nullptr; +#else + const uint winType = WS_EX_TOOLWINDOW; + const HWND parent = (HWND)parentId; #endif fWindow = CreateWindowEx(winType, @@ -775,14 +775,14 @@ public: SetWindowLongPtr(fWindow, GWLP_USERDATA, (LONG_PTR)this); -#ifdef BUILDING_CARLA_FOR_WINDOWS +#ifndef BUILDING_CARLA_FOR_WINE if (parentId != 0) setTransientWinId(parentId); -#else +#endif return; - // unused + + // maybe unused (void)parentId; -#endif } ~WindowsPluginUI() override