diff --git a/CMakeLists.txt b/CMakeLists.txt index adddaa6c..a2af918f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # TODO Remove This before we ship non beta version. Remember # the AU rescans only when versions change even if binaries are # different. -message(STATUS "ShortcircuitXT: Using date-driven version while in alpha") string(TIMESTAMP DAY_OF_YEAR "%j") string(TIMESTAMP YEAR "%Y") math(EXPR PART0 "${YEAR}-2023 + 6") @@ -32,25 +31,10 @@ math(EXPR PART1 "${DAY_OF_YEAR} + 1") project(ShortcircuitXT VERSION 0.${PART0}.${PART1}.0 LANGUAGES C CXX ASM) set(ShortcircuitXT_VERSION ${PROJECT_VERSION}) +message(STATUS "ShortcircuitXT: Using date-driven version while in alpha - ${PROJECT_VERSION}") -if (APPLE) - enable_language(OBJC) - enable_language(OBJCXX) - set(CMAKE_OBJC_VISIBILITY_PRESET hidden) - set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden) - if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "15.0.0" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "15.1") - add_link_options(-Wl,-ld_classic) - add_compile_definitions(JUCE_SILENCE_XCODE_15_LINKER_WARNING=1) - endif() -endif () - -set(BUILD_SHARED_LIBS OFF CACHE BOOL "Never want shared if not specified") -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_VISIBILITY_PRESET hidden) -set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) -set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - +include(libs/sst/sst-plugininfra/cmake/git-version-functions.cmake) +version_from_versionfile_or_git() # Build Time Options option(SCXT_BUILD_VST3 "Build a VST3 plugin" ON) @@ -78,12 +62,6 @@ else() option(SCXT_USE_CLAP_WRAPPER_STANDALONE "Build with the clap wrapper standalone rather than our temp one" OFF) endif() -# Calculate bitness -math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}") -if (NOT ${BITS} EQUAL 64) - message(WARNING "${PROJECT_NAME} has only been tested on 64 bits. This may not work") -endif () - # Share some information about the build message(STATUS "Shortcircuit XT ${CMAKE_PROJECT_VERSION}") message(STATUS "Compiler Version is ${CMAKE_CXX_COMPILER_VERSION}") @@ -91,36 +69,14 @@ if (MSVC) message(STATUS "Windows Architecture is ${CMAKE_GENERATOR_PLATFORM}") endif() -# Everything here is C++ 17 now -if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND UNIX AND NOT APPLE AND NOT SCXT_SKIP_PIE_CHANGE) - message(STATUS "Setting -no-pie on EXE flags; use SCXT_SKIP_PIE_CHANGE=TRUE to avoid") - set(CMAKE_EXE_LINKER_FLAGS "-no-pie") -endif () - -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - if (${SCXT_SANITIZE}) - message(STATUS "Sanitizer is ON") - endif () - - # BP note: If you want to turn on llvm/gcc sanitize, remove this and the link options below - add_compile_options( - $<$:-fsanitize=address> - $<$:-fsanitize=undefined> - ) - - add_link_options( - $<$:-fsanitize=address> - $<$:-fsanitize=undefined> - ) -endif () -add_compile_definitions(SCXT_ROOT_BUILD_DIR="${CMAKE_SOURCE_DIR}") - -include(cmake/compiler-and-git.cmake) +include(cmake/compiler-options.cmake) include(cmake/CmakeRC.cmake) +# Setup libraries add_subdirectory(libs) + # Next for now add_subdirectory(src) add_subdirectory(resources) @@ -128,24 +84,6 @@ add_subdirectory(src-ui) add_subdirectory(tests) add_subdirectory(clients) -include(cmake/basic-installer.cmake) +include(cmake/basic-installer.cmake) -add_custom_target(scxt-code-checks) - -# Clang Format checks -find_program(CLANG_FORMAT_EXE NAMES clang-format-12 clang-format) -set(CLANG_FORMAT_DIRS src src-ui tests clients) -set(CLANG_FORMAT_EXTS cpp h) -foreach (dir ${CLANG_FORMAT_DIRS}) - foreach (ext ${CLANG_FORMAT_EXTS}) - list(APPEND CLANG_FORMAT_GLOBS "':(glob)${dir}/**/*.${ext}'") - endforeach () -endforeach () -add_custom_command(TARGET scxt-code-checks - POST_BUILD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} -E echo About to check clang-format using ${CLANG_FORMAT_EXE} - COMMAND git ls-files -- ${CLANG_FORMAT_GLOBS} | xargs ${CLANG_FORMAT_EXE} --dry-run --Werror - ) -# }}} \ No newline at end of file diff --git a/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp b/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp index f04e3d3c..578a2442 100644 --- a/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp +++ b/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp @@ -35,8 +35,6 @@ #include #include "utils.h" -#include "version.h" - #include "engine/engine.h" #include "app/SCXTEditor.h" #include "sst/voicemanager/midi1_to_voicemanager.h" diff --git a/clients/clap-first/scxt-plugin/scxt-plugin.cpp b/clients/clap-first/scxt-plugin/scxt-plugin.cpp index b14b7d22..0f35610d 100644 --- a/clients/clap-first/scxt-plugin/scxt-plugin.cpp +++ b/clients/clap-first/scxt-plugin/scxt-plugin.cpp @@ -29,7 +29,7 @@ #include #include "scxt-plugin.h" -#include "version.h" +#include "sst/plugininfra/version_information.h" #include "app/SCXTEditor.h" namespace scxt::clap_first::scxt_plugin @@ -39,16 +39,17 @@ const clap_plugin_descriptor *getDescription() static const char *features[] = {CLAP_PLUGIN_FEATURE_INSTRUMENT, CLAP_PLUGIN_FEATURE_SAMPLER, CLAP_PLUGIN_FEATURE_SYNTHESIZER, "Free and Open Source", nullptr}; - static clap_plugin_descriptor desc = {CLAP_VERSION, - "org.surge-synth-team.shortcircuit-xt", - "Shortcircuit XT", - "Surge Synth Team", - "https://surge-synth-team.org", - "", - "", - scxt::build::FullVersionStr, - "The Flagship Creative Sampler from the Surge Synth Team", - &features[0]}; + static clap_plugin_descriptor desc = { + CLAP_VERSION, + "org.surge-synth-team.shortcircuit-xt", + "Shortcircuit XT", + "Surge Synth Team", + "https://surge-synth-team.org", + "", + "", + sst::plugininfra::VersionInformation::project_version_and_hash, + "The Flagship Creative Sampler from the Surge Synth Team", + &features[0]}; return &desc; } diff --git a/cmake/code-quality.cmake b/cmake/code-quality.cmake deleted file mode 100644 index 2e886446..00000000 --- a/cmake/code-quality.cmake +++ /dev/null @@ -1,17 +0,0 @@ - -add_custom_target(code-quality-pipeline-checks) - -# Clang Format checks -set(CLANG_FORMAT_DIRS src wrappers tests) -set(CLANG_FORMAT_EXTS cpp h) -foreach (dir ${CLANG_FORMAT_DIRS}) - foreach (ext ${CLANG_FORMAT_EXTS}) - list(APPEND CLANG_FORMAT_GLOBS "':(glob)${dir}/**/*.${ext}'") - endforeach () -endforeach () -add_custom_command(TARGET code-quality-pipeline-checks - POST_BUILD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} -E echo About to check clang-format using clang-format-12 - COMMAND git ls-files -- ${CLANG_FORMAT_GLOBS} | xargs clang-format-12 --dry-run --Werror - ) diff --git a/cmake/compiler-and-git.cmake b/cmake/compiler-options.cmake similarity index 59% rename from cmake/compiler-and-git.cmake rename to cmake/compiler-options.cmake index 57435ed4..f7cdc502 100644 --- a/cmake/compiler-and-git.cmake +++ b/cmake/compiler-options.cmake @@ -1,38 +1,60 @@ -# Set up version information using the same approach as surge, namely -# with an external cmake run, a git-info target, and a generated -# ${bld}/geninclude/version.cpp - -add_custom_target(version-info BYPRODUCTS ${CMAKE_BINARY_DIR}/geninclude/version.cpp - DEPENDS ${CMAKE_SOURCE_DIR}/cmake/version.h - ${CMAKE_SOURCE_DIR}/cmake/version.cpp.in - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} - -D PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} - -D PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR} - -D SHORTCSRC=${CMAKE_SOURCE_DIR} - -D SHORTCBLD=${CMAKE_BINARY_DIR} - -D AZURE_PIPELINE=${AZURE_PIPELINE} - -D WIN32=${WIN32} - -D CMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID} - -D CMAKE_CXX_COMPILER_VERSION=${CMAKE_CXX_COMPILER_VERSION} - -P ${CMAKE_SOURCE_DIR}/cmake/versiontools.cmake -) + +# Calculate bitness +math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}") +if (NOT ${BITS} EQUAL 64) + message(WARNING "${PROJECT_NAME} has only been tested on 64 bits. This may not work") +endif () + + +# Everything here is C++ 17 now +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND UNIX AND NOT APPLE AND NOT SCXT_SKIP_PIE_CHANGE) + message(STATUS "Setting -no-pie on EXE flags; use SCXT_SKIP_PIE_CHANGE=TRUE to avoid") + set(CMAKE_EXE_LINKER_FLAGS "-no-pie") +endif () + +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + if (${SCXT_SANITIZE}) + message(STATUS "Sanitizer is ON") + endif () + + # BP note: If you want to turn on llvm/gcc sanitize, remove this and the link options below + add_compile_options( + $<$:-fsanitize=address> + $<$:-fsanitize=undefined> + ) + + add_link_options( + $<$:-fsanitize=address> + $<$:-fsanitize=undefined> + ) +endif () + # Platform Specific Compile Settings -add_library(sc-compiler-options) +add_library(sc-compiler-options INTERFACE) -target_sources(sc-compiler-options PRIVATE ${CMAKE_BINARY_DIR}/geninclude/version.cpp) +set(BUILD_SHARED_LIBS OFF CACHE BOOL "Never want shared if not specified") +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) +set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) -target_include_directories(sc-compiler-options PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +if (${BUILD_SHARED_LIBS}) + message(FATAL_ERROR "You have overriden BUILD_SHARED_LIBS to be ON. This is an unsupported configuration") +endif() -# visibility needs to be consistent across the whole project -add_compile_options( - # PE/COFF doesn't support visibility - $<$>:-fvisibility=hidden> +if (APPLE) + enable_language(OBJC) + enable_language(OBJCXX) + set(CMAKE_OBJC_VISIBILITY_PRESET hidden) + set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden) + if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "15.0.0" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "15.1") + add_link_options(-Wl,-ld_classic) + add_compile_definitions(JUCE_SILENCE_XCODE_15_LINKER_WARNING=1) + endif() +endif () - # Inlines visibility is only relevant with C++ - $<$>,$>:-fvisibility-inlines-hidden> -) if (APPLE) set(OS_COMPILE_OPTIONS diff --git a/cmake/version.cpp.in b/cmake/version.cpp.in deleted file mode 100644 index 5159659f..00000000 --- a/cmake/version.cpp.in +++ /dev/null @@ -1,39 +0,0 @@ -/* -** This file is rebuilt and substitited every time you run a build. -** Things which need to be per-build should be defined here, declared -** in the version.h header, and then used wherever you want -*/ -#include - -// clang-format off -namespace scxt -{ -const char *build::MajorVersionStr = "@SHORTC_MAJOR_VERSION@"; -const int build::MajorVersionInt = @SHORTC_MAJOR_VERSION@; - -const char *build::SubVersionStr = "@SHORTC_SUB_VERSION@"; -const int build::SubVersionInt = @SHORTC_SUB_VERSION@; - -const char *build::ReleaseNumberStr = "@SHORTC_RELEASE_NUMBER@"; -const char *build::ReleaseStr = "@SHORTC_RELEASE_VERSION@"; - -const char *build::BuildNumberStr = - "@SHORTC_BUILD_HASH@"; // Build number to be sure that each result could identified. - -const char *build::FullVersionStr = "@SHORTC_FULL_VERSION@"; -const char *build::BuildHost = "@SHORTC_BUILD_FQDN@"; -const char *build::BuildArch = "@SHORTC_BUILD_ARCH@"; -const char *build::BuildCompiler = "@CMAKE_CXX_COMPILER_ID@-@CMAKE_CXX_COMPILER_VERSION@"; - -const char *build::BuildLocation = "@SHORTC_BUILD_LOCATION@"; - -const char *build::BuildDate = "@SHORTC_BUILD_DATE@"; -const char *build::BuildTime = "@SHORTC_BUILD_TIME@"; -const char *build::BuildYear = "@SHORTC_BUILD_YEAR@"; - -const char *build::GitHash = "@GIT_COMMIT_HASH@"; -const char *build::GitBranch = "@GIT_BRANCH@"; - -const char *build::CMAKE_INSTALL_PREFIX = "@CMAKE_INSTALL_PREFIX@"; -} // namespace scxt -//clang-format on diff --git a/cmake/version.h b/cmake/version.h deleted file mode 100644 index f8216954..00000000 --- a/cmake/version.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Shortcircuit XT - a Surge Synth Team product - * - * A fully featured creative sampler, available as a standalone - * and plugin for multiple platforms. - * - * Copyright 2019 - 2023, Various authors, as described in the github - * transaction log. - * - * ShortcircuitXT is released under the Gnu General Public Licence - * V3 or later (GPL-3.0-or-later). The license is found in the file - * "LICENSE" in the root of this repository or at - * https://www.gnu.org/licenses/gpl-3.0.en.html - * - * Individual sections of code which comprises ShortcircuitXT in this - * repository may also be used under an MIT license. Please see the - * section "Licensing" in "README.md" for details. - * - * ShortcircuitXT is inspired by, and shares code with, the - * commercial product Shortcircuit 1 and 2, released by VemberTech - * in the mid 2000s. The code for Shortcircuit 2 was opensourced in - * 2020 at the outset of this project. - * - * All source for ShortcircuitXT is available at - * https://github.com/surge-synthesizer/shortcircuit-xt - */ -#ifndef SCXT_SRC_VERSION_H -#define SCXT_SRC_VERSION_H - -namespace scxt -{ -struct build -{ - static const char *MajorVersionStr; - static const int MajorVersionInt; - - static const char *SubVersionStr; - static const int SubVersionInt; - - static const char *ReleaseNumberStr; - static const char *ReleaseStr; - - static const char *GitHash; - static const char *GitBranch; - - static const char *BuildNumberStr; - - static const char *FullVersionStr; - static const char *BuildHost; - static const char *BuildArch; - - static const char *BuildLocation; // Local or Pipeline - - static const char *BuildDate; - static const char *BuildTime; - static const char *BuildYear; - - // Some features from cmake - static const char *CMAKE_INSTALL_PREFIX; - static const char *BuildCompiler; -}; -} // namespace scxt - -#endif //__version__ diff --git a/cmake/versiontools.cmake b/cmake/versiontools.cmake deleted file mode 100644 index 312378bc..00000000 --- a/cmake/versiontools.cmake +++ /dev/null @@ -1,118 +0,0 @@ - -find_package(Git) - -if( EXISTS ${SHORTCSRC}/VERSION_GIT_INFO ) - message( STATUS "VERSION_GIT_INFO file is present; using that rather than git query" ) - # Line 2 is the branch, line 3 is the hash - execute_process( - COMMAND sed -n "2p" ${SHORTCSRC}/VERSION_GIT_INFO - WORKING_DIRECTORY ${SHORTCSRC} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - execute_process( - COMMAND sed -n "3p" ${SHORTCSRC}/VERSION_GIT_INFO - WORKING_DIRECTORY ${SHORTCSRC} - OUTPUT_VARIABLE GIT_COMMIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - -elseif( Git_FOUND ) - execute_process( - COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${SHORTCSRC} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - execute_process( - COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD - WORKING_DIRECTORY ${SHORTCSRC} - OUTPUT_VARIABLE GIT_COMMIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) -endif() - -if("${GIT_BRANCH}" STREQUAL "") - message(WARNING "Could not determine Git branch, using placeholder.") - set(GIT_BRANCH "git-no-branch") -endif() -if ("${GIT_COMMIT_HASH}" STREQUAL "") - message(WARNING "Could not determine Git commit hash, using placeholder.") - set(GIT_COMMIT_HASH "git-no-commit") -endif() - -if( WIN32 ) - set( SHORTC_BUILD_ARCH "Intel" ) -else() - execute_process( - COMMAND uname -m - OUTPUT_VARIABLE SHORTC_BUILD_ARCH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) -endif() - -cmake_host_system_information(RESULT SHORTC_BUILD_FQDN QUERY FQDN ) - -message( STATUS "Setting up Shortcircuit XT version:" ) -message( STATUS " Git hash is ${GIT_COMMIT_HASH} and branch is ${GIT_BRANCH}" ) -message( STATUS " Build host is ${SHORTC_BUILD_FQDN}" ) -message( STATUS " Build architecture is ${SHORTC_BUILD_ARCH}" ) - -if( ${AZURE_PIPELINE} ) - message( STATUS "Azure pipeline build" ) - set( lpipeline "pipeline" ) -else() - message( STATUS "Developer local build" ) - set( lpipeline "local" ) -endif() - -if(${GIT_BRANCH} STREQUAL "main" ) - if( ${AZURE_PIPELINE} ) - set( lverpatch "nightly" ) - else() - set( lverpatch "main" ) - endif() - set( lverrel "999" ) - set( fverpatch ${lverpatch} ) -else() - string( FIND ${GIT_BRANCH} "release/" RLOC ) - if( ${RLOC} EQUAL 0 ) - message( STATUS "Configuring a Release build from '${GIT_BRANCH}'" ) - string( SUBSTRING ${GIT_BRANCH} 11 100 RV ) # that's release slash 1.7. - string( FIND ${RV} "." DLOC ) - if( NOT ( DLOC EQUAL -1 ) ) - math( EXPR DLP1 "${DLOC} + 1" ) - string( SUBSTRING ${RV} ${DLP1} 100 LRV ) # skip that first dots - set( lverrel ${LRV} ) - else() - set( lverrel "99" ) - endif() - set( lverpatch "stable-${lverrel}" ) - set( fverpatch "${lverrel}" ) - else() - set( lverpatch ${GIT_BRANCH} ) - set( fverpatch ${lverpatch} ) - set( lverrel "1000" ) - endif() -endif() - -set( SHORTC_FULL_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${fverpatch}.${GIT_COMMIT_HASH}" ) -set( SHORTC_MAJOR_VERSION "${PROJECT_VERSION_MAJOR}" ) -set( SHORTC_SUB_VERSION "${PROJECT_VERSION_MINOR}" ) -set( SHORTC_RELEASE_VERSION "${lverpatch}" ) -set( SHORTC_RELEASE_NUMBER "${lverrel}" ) -set( SHORTC_BUILD_HASH "${GIT_COMMIT_HASH}" ) -set( SHORTC_BUILD_LOCATION "${lpipeline}" ) - -string( TIMESTAMP SHORTC_BUILD_DATE "%Y-%m-%d" ) -string( TIMESTAMP SHORTC_BUILD_YEAR "%Y" ) -string( TIMESTAMP SHORTC_BUILD_TIME "%H:%M:%S" ) - -message( STATUS "Using SHORTC_VERSION=${SHORTC_FULL_VERSION}" ) - -message( STATUS "Configuring ${SHORTCBLD}/geninclude/version.cpp" ) -configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cpp.in - ${SHORTCBLD}/geninclude/version.cpp ) -file(WRITE ${SHORTCBLD}/geninclude/githash.txt ${GIT_COMMIT_HASH}) diff --git a/libs/sst/sst-plugininfra b/libs/sst/sst-plugininfra index 4ef3837a..e27aca5f 160000 --- a/libs/sst/sst-plugininfra +++ b/libs/sst/sst-plugininfra @@ -1 +1 @@ -Subproject commit 4ef3837a8dd6e3f2d077b2c278f25e2f4d5f0079 +Subproject commit e27aca5f1c3f45b12807e174d6544b224623ccaa diff --git a/src-ui/app/editor-impl/SCXTEditorMenus.cpp b/src-ui/app/editor-impl/SCXTEditorMenus.cpp index e8dafc5f..a08b4b88 100644 --- a/src-ui/app/editor-impl/SCXTEditorMenus.cpp +++ b/src-ui/app/editor-impl/SCXTEditorMenus.cpp @@ -30,6 +30,7 @@ #endif #include "infrastructure/user_defaults.h" +#include "sst/plugininfra/version_information.h" #include "sst/jucegui/component-adapters/ComponentTags.h" #include "sst/clap_juce_shim/menu_helper.h" @@ -45,8 +46,6 @@ #include "app/other-screens/AboutScreen.h" #include "app/shared/MenuValueTypein.h" -#include - namespace scxt::ui::app { namespace cmsg = scxt::messaging::client; @@ -75,7 +74,8 @@ void SCXTEditor::showMainMenu() m.addSubMenu("UI Behavior", skin); m.addSeparator(); - m.addItem(juce::String("Copy ") + scxt::build::FullVersionStr, + m.addItem(juce::String("Copy ") + + sst::plugininfra::VersionInformation::project_version_and_hash, [w = juce::Component::SafePointer(this)] { if (w) w->aboutScreen->copyInfo(); diff --git a/src-ui/app/other-screens/AboutScreen.cpp b/src-ui/app/other-screens/AboutScreen.cpp index ffd052a0..f0ec53d6 100644 --- a/src-ui/app/other-screens/AboutScreen.cpp +++ b/src-ui/app/other-screens/AboutScreen.cpp @@ -27,12 +27,11 @@ #include "AboutScreen.h" #include "utils.h" +#include "sst/plugininfra/version_information.h" #include "sst/plugininfra/cpufeatures.h" #include "app/SCXTEditor.h" #include "connectors/SCXTResources.h" -#include - namespace scxt::ui::app::other_screens { struct AboutLink : juce::Component, HasEditor @@ -88,7 +87,9 @@ AboutScreen::~AboutScreen() {} void AboutScreen::resetInfo() { info.clear(); - std::string ver = scxt::build::FullVersionStr; + std::string ver = sst::plugininfra::VersionInformation::git_implied_display_version; + ver += " / "; + ver += sst::plugininfra::VersionInformation::project_version_and_hash; ver += " (JUCE " + std::to_string(JUCE_MAJOR_VERSION) + "." + std::to_string(JUCE_MINOR_VERSION) + "." + std::to_string(JUCE_BUILDNUMBER) + ")"; info.push_back({"Version", ver, false}); @@ -103,8 +104,9 @@ void AboutScreen::resetInfo() platform += " on " + sst::plugininfra::cpufeatures::brand(); info.push_back({"System", platform, false}); info.push_back({"Build", - std::string() + scxt::build::BuildDate + " " + scxt::build::BuildTime + - " with " + scxt::build::BuildCompiler, + std::string() + sst::plugininfra::VersionInformation::build_date + " " + + sst::plugininfra::VersionInformation::build_time + " with " + + sst::plugininfra::VersionInformation::cmake_compiler, false}); info.push_back({"Env", fmt::format("{} at {} Hz", editor->engineStatus.runningEnvironment, diff --git a/src-ui/app/shared/HeaderRegion.h b/src-ui/app/shared/HeaderRegion.h index 7321c98d..9092ac65 100644 --- a/src-ui/app/shared/HeaderRegion.h +++ b/src-ui/app/shared/HeaderRegion.h @@ -37,8 +37,6 @@ #include #include -#include - #include "sst/jucegui/components/ToggleButtonRadioGroup.h" #include "sst/jucegui/data/Discrete.h" #include "app/HasEditor.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f640a70..ca3f7ffd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -81,6 +81,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC sst-plugininfra sst-plugininfra::tinyxml sst-plugininfra::miniz + sst-plugininfra::version_information sst-voicemanager libgig libakai diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index a8f5d8be..4a9c9561 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -26,6 +26,9 @@ */ #include "engine.h" + +#include "sst/plugininfra/version_information.h" + #include "configuration.h" #include "messaging/audio/audio_serial.h" #include "part.h" @@ -50,7 +53,6 @@ #include "gig.h" #include "SF.h" -#include #include #include #include "messaging/client/client_serial.h" @@ -65,7 +67,9 @@ namespace scxt::engine Engine::Engine() { SCLOG("Shortcircuit XT : Constructing Engine"); - SCLOG(" Version = " << scxt::build::FullVersionStr); + SCLOG(" Version = " << sst::plugininfra::VersionInformation::git_implied_display_version + << " / " + << sst::plugininfra::VersionInformation::project_version_and_hash); SCLOG(" Stream V = " << humanReadableVersion(scxt::currentStreamingVersion)); memset(cpuAverages, 0, sizeof(cpuAverages)); @@ -121,7 +125,8 @@ Engine::Engine() messageController->start(); - browserDb->writeDebugMessage(std::string("SCXT Startup ") + build::FullVersionStr); + browserDb->writeDebugMessage(std::string("SCXT Startup ") + + sst::plugininfra::VersionInformation::project_version_and_hash); // This forces metadata init of the mod matrix modulation::ModulationCurves::initializeCurves(); diff --git a/src/utils.cpp b/src/utils.cpp index 724110d6..5d54d2c5 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -36,6 +36,8 @@ #include #include +#include "sst/plugininfra/version_information.h" + #if MAC || LINUX #include #include @@ -70,11 +72,11 @@ void postToLog(const std::string &s) { // TODO this sucks also auto q = s; - auto sp = q.find(SCXT_ROOT_BUILD_DIR); + auto sp = q.find(sst::plugininfra::VersionInformation::cmake_source_dir); if (sp == 0) { - q = q.substr(sp + strlen(SCXT_ROOT_BUILD_DIR) + 1); + q = q.substr(sp + strlen(sst::plugininfra::VersionInformation::cmake_source_dir) + 1); } std::cout << q << std::flush; std::lock_guard g(logMutex);