Skip to content

Commit

Permalink
Some more ARM64EC surge tweaks (#7835)
Browse files Browse the repository at this point in the history
* Some more ARM64EC surge tweaks

1. A header fragility ordering thing wiht MSVC
2. A Rectangle ambiguity
3. Turn the pipeline back on for arm64ec PR

* format

* Potentially ready for a release build

* format

---------

Co-authored-by: Paul Walker (Baconpaul) <[email protected]>
  • Loading branch information
baconpaul and Paul Walker (Baconpaul) authored Nov 1, 2024
1 parent b490f99 commit c36fea5
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
cmakeOpt: DEBUG
runTests: false

#- name: "windows msvc arm64ec"
# os: windows-latest
# target: surge-xt_Standalone
# cmakeConfig: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10 -DSURGE_SKIP_LUA=TRUE
# cmakeOpt: DEBUG
# runTests: false
- name: "windows msvc arm64ec"
os: windows-latest
target: surge-xt_Standalone
cmakeConfig: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10 -DSURGE_SKIP_LUA=TRUE
cmakeOpt: DEBUG
runTests: false

- name: "windows clang"
os: windows-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
name: windows-64bit
cmakeArgs: -GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang

- os: windows-latest
name: windows-arm64ec
cmakeArgs: -G"Visual Studio 17 2022" -A arm64ec -DSURGE_SKIP_LUA=TRUE

- os: macos-latest
name: macos
cmakeArgs: -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ if(MSVC)
/wd4388 # signed unsigned mismatch in comparison
/wd4065 # standalone default in a switch with no case
/wd4702 # unreachable code. I generally do if( a ) return foo else return bar; return nullptr so don't warn on that
/wd4005 # macro redefinition. Thanks NOMINMAX

# Clang-cl-only warnings
$<$<CXX_COMPILER_ID:Clang>:-Wno-microsoft-exception-spec>
Expand Down
31 changes: 19 additions & 12 deletions src/cmake/lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ function(surge_make_installers)
if (${SURGE_BITNESS} EQUAL 64)
set(SURGE_PORTABLE_DIR ${CMAKE_BINARY_DIR}/surge-xt-portable)
set(portsst "${SURGE_PORTABLE_DIR}/Surge Synth Team")
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64ec")
set(WINARCH "-arm64ec-beta")
endif()
add_custom_command(TARGET surge-xt-distribution
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${SURGE_PORTABLE_DIR}
Expand All @@ -167,32 +170,36 @@ function(surge_make_installers)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${SURGE_PRODUCT_DIR}/Surge XT.vst3" "${portsst}/Surge XT.vst3"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${SURGE_PRODUCT_DIR}/Surge XT Effects.vst3" "${portsst}/Surge XT Effects.vst3"

COMMAND 7z a -r ${SURGE_XT_DIST_OUTPUT_DIR}/surge-xt-win${SURGE_BITNESS}-${SXTVER}-pluginsonly.zip "${portsst}/*"
COMMAND 7z a -r ${SURGE_XT_DIST_OUTPUT_DIR}/surge-xt-win${SURGE_BITNESS}${WINARCH}-${SXTVER}-pluginsonly.zip "${portsst}/*"

COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/resources/surge-shared/README_Portable.txt" "${SURGE_PORTABLE_DIR}/README.txt"

COMMAND ${CMAKE_COMMAND} -E make_directory "${portsst}/SurgeXTData"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/resources/data" "${portsst}/SurgeXTData"

COMMAND 7z a -r ${SURGE_XT_DIST_OUTPUT_DIR}/surge-xt-win${SURGE_BITNESS}-${SXTVER}-portable-install.zip "${SURGE_PORTABLE_DIR}/*"
COMMAND 7z a -r ${SURGE_XT_DIST_OUTPUT_DIR}/surge-xt-win${SURGE_BITNESS}${WINARCH}-${SXTVER}-portable-install.zip "${SURGE_PORTABLE_DIR}/*"
)
else()
add_custom_command(TARGET surge-xt-distribution
POST_BUILD
COMMAND 7z a -r ${SURGE_XT_DIST_OUTPUT_DIR}/surge-xt-win${SURGE_BITNESS}-${SXTVER}-pluginsonly.zip ${SURGE_PRODUCT_DIR}
)
endif()
find_program(SURGE_NUGET_EXE nuget.exe PATHS ENV "PATH")
if(SURGE_NUGET_EXE)
message(STATUS "Using NUGET from ${SURGE_NUGET_EXE}")
add_custom_command(TARGET surge-xt-distribution
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${SURGE_NUGET_EXE} install Tools.InnoSetup -version 6.1.2
COMMAND Tools.InnoSetup.6.1.2/tools/iscc.exe /O"${SURGE_XT_DIST_OUTPUT_DIR}" /DSURGE_SRC="${CMAKE_SOURCE_DIR}" /DSURGE_BIN="${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/scripts/installer_win/surge${SURGE_BITNESS}.iss"
)
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64ec")
message(STATUS "Not making installer for arm64ec")
else()
message(STATUS "NuGet not found, not creating InnoSetup installer")
find_program(SURGE_NUGET_EXE nuget.exe PATHS ENV "PATH")
if(SURGE_NUGET_EXE)
message(STATUS "Using NUGET from ${SURGE_NUGET_EXE}")
add_custom_command(TARGET surge-xt-distribution
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${SURGE_NUGET_EXE} install Tools.InnoSetup -version 6.1.2
COMMAND Tools.InnoSetup.6.1.2/tools/iscc.exe /O"${SURGE_XT_DIST_OUTPUT_DIR}" /DSURGE_SRC="${CMAKE_SOURCE_DIR}" /DSURGE_BIN="${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/scripts/installer_win/surge${SURGE_BITNESS}.iss"
)
else()
message(STATUS "NuGet not found, not creating InnoSetup installer")
endif()
endif()
endif()
endfunction()
6 changes: 3 additions & 3 deletions src/surge-fx/FXOpenSoundControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* held by Claes Johanson at Vember Audio during that period.
* Claes made Surge open source in September 2018.
*/

#ifndef SURGE_SRC_SURGE_FX_FXOPENSOUNDCONTROL_H
#define SURGE_SRC_SURGE_FX_FXOPENSOUNDCONTROL_H
/* All source for Surge XT is available at
* https://github.com/surge-synthesizer/surge
*/

#include <juce_gui_extra/juce_gui_extra.h>

#include "juce_osc/juce_osc.h"
#include "SurgeSynthesizer.h"
Expand Down
1 change: 1 addition & 0 deletions src/surge-xt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
juce::juce_audio_processors
juce::juce_audio_plugin_client
juce::juce_osc
juce::juce_gui_basics
surge-xt-binary
sst-filters-extras
)
Expand Down
7 changes: 5 additions & 2 deletions src/surge-xt/cli/cli-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
* https://github.com/surge-synthesizer/surge
*/

#include <iostream>

#include <juce_core/juce_core.h>
#include <juce_events/juce_events.h>
#include <juce_audio_devices/juce_audio_devices.h>
#if defined(_M_ARM64EC)
#include <juce_gui_extra/juce_gui_extra.h>
#endif

#include <iostream>
#include <CLI11/CLI11.hpp>

#include "version.h"
Expand Down
21 changes: 12 additions & 9 deletions src/surge-xt/gui/SurgeJUCELookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* https://github.com/surge-synthesizer/surge
*/

#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>

#include "SurgeJUCELookAndFeel.h"
#include "RuntimeFont.h"
#include "SkinSupport.h"
Expand Down Expand Up @@ -253,12 +256,12 @@ void SurgeJUCELookAndFeel::drawDocumentWindowTitleBar(DocumentWindow &window, Gr
icon->drawAt(g, titleCenter - (titleTextWidth / 2) - 14 - textMargin, h / 2 - 7, 1.0);
}

auto boxSurge = Rectangle<int>(titleCenter - (titleTextWidth / 2), 0, sw, h);
auto boxSurge = juce::Rectangle<int>(titleCenter - (titleTextWidth / 2), 0, sw, h);
g.setFont(fontSurge);
g.drawText(surgeLabel, boxSurge, Justification::centredLeft);

auto boxVersion =
Rectangle<int>(titleCenter - (titleTextWidth / 2) + sw + textMargin, 0, vw, h);
juce::Rectangle<int>(titleCenter - (titleTextWidth / 2) + sw + textMargin, 0, vw, h);
g.setFont(fontVersion);
g.drawText(surgeVersion, boxVersion, Justification::centredLeft);
}
Expand All @@ -284,11 +287,11 @@ class SurgeJUCELookAndFeel_DocumentWindowButton : public Button
g.setColour(colour);
auto &p = getToggleState() ? toggledShape : normalShape;

auto reducedRect =
Justification(Justification::centred)
.appliedToRectangle(Rectangle<int>(getHeight(), getHeight()), getLocalBounds())
.toFloat()
.reduced((float)getHeight() * 0.25f);
auto reducedRect = Justification(Justification::centred)
.appliedToRectangle(juce::Rectangle<int>(getHeight(), getHeight()),
getLocalBounds())
.toFloat()
.reduced((float)getHeight() * 0.25f);

g.fillPath(p, p.getTransformToScaleToFit(reducedRect, true));
}
Expand Down Expand Up @@ -360,7 +363,7 @@ juce::Font SurgeJUCELookAndFeel::getPopupMenuBoldFont()
}

// overridden here just to make the shortcut text same size as normal menu entry text
void SurgeJUCELookAndFeel::drawPopupMenuItem(Graphics &g, const Rectangle<int> &area,
void SurgeJUCELookAndFeel::drawPopupMenuItem(Graphics &g, const juce::Rectangle<int> &area,
const bool isSeparator, const bool isActive,
const bool isHighlighted, const bool isTicked,
const bool hasSubMenu, const String &text,
Expand Down Expand Up @@ -479,7 +482,7 @@ void SurgeJUCELookAndFeel::updateDarkIfNeeded()
}
}
void SurgeJUCELookAndFeel::drawPopupMenuSectionHeaderWithOptions(Graphics &graphics,
const Rectangle<int> &area,
const juce::Rectangle<int> &area,
const String &sectionName,
const PopupMenu::Options &options)
{
Expand Down
2 changes: 2 additions & 0 deletions src/surge-xt/gui/overlays/KeyBindingsOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* https://github.com/surge-synthesizer/surge
*/

#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>
#include "KeyBindingsOverlay.h"
#include <SurgeJUCELookAndFeel.h>
#include "widgets/MenuCustomComponents.h"
Expand Down
3 changes: 2 additions & 1 deletion src/surge-xt/gui/overlays/LuaEditors.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
#ifndef SURGE_SRC_SURGE_XT_GUI_OVERLAYS_LUAEDITORS_H
#define SURGE_SRC_SURGE_XT_GUI_OVERLAYS_LUAEDITORS_H

#include <juce_gui_extra/juce_gui_extra.h>

#include "SurgeStorage.h"
#include "SkinSupport.h"

#include "juce_gui_extra/juce_gui_extra.h"
#include "OverlayComponent.h"
#include "RefreshableOverlay.h"

Expand Down
4 changes: 3 additions & 1 deletion src/surge-xt/gui/overlays/TuningOverlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
* All source for Surge XT is available at
* https://github.com/surge-synthesizer/surge
*/

#include <juce_gui_extra/juce_gui_extra.h>

#include "TuningOverlays.h"
#include "RuntimeFont.h"
#include "SurgeStorage.h"
Expand All @@ -29,7 +32,6 @@
#include "widgets/MultiSwitch.h"
#include "fmt/core.h"
#include <chrono>
#include "juce_gui_extra/juce_gui_extra.h"
#include "UnitConversions.h"
#include "libMTSClient.h"

Expand Down
2 changes: 2 additions & 0 deletions src/surge-xt/osc/OpenSoundControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* https://github.com/surge-synthesizer/surge
*/

#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>
#include "OpenSoundControl.h"
#include "Parameter.h"
#include "SurgeSynthProcessor.h"
Expand Down

0 comments on commit c36fea5

Please sign in to comment.