diff --git a/.dir-locals.el b/.dir-locals.el index 40fedb5..7cb8dae 100755 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -10,7 +10,7 @@ (projectile-project-name . "SampleHive") (projectile-project-run-cmd . "~/repos/sample-hive/build/SampleHive") ;; (projectile-project-run-cmd . "/tmp/SampleHive/bin/SampleHive") - (compile-command . "cd .. && ninja -C build install") + (compile-command . "ninja -C ~/repos/sample-hive/build") (fill-column . 110) ;; Setup dap debugging template for the project (setq dap-debug-template-configurations diff --git a/meson.build b/meson.build index a2203d1..2bb1a08 100755 --- a/meson.build +++ b/meson.build @@ -77,6 +77,12 @@ config_data.set_quoted('LIBDIR', libdir) config_data.set_quoted('DATADIR', datadir) config_data.set_quoted('SAMPLEHIVE_DATADIR', samplehive_datadir) +if build_type == 'debug' or build_type == 'debugoptimized' + config_data.set('SH_BUILD_DEBUG', 1) +elif build_type == 'release' + config_data.set('SH_BUILD_RELEASE', 1) +endif + # Import CMake cmake = import('cmake') @@ -196,6 +202,13 @@ src = [ include_dirs = include_directories('src') +# Static link C/C++ libs if platform is windows +link_args = [] + +if host_sys == 'windows' + link_args += ['-static-libgcc', '-static-libstdc++'] +endif + # Dependencies wx = dependency('wxwidgets', version: '>=3.1.5', required: false) @@ -276,7 +289,7 @@ install_subdir('assets', executable('SampleHive', sources: src, cpp_args: [wx_cxx_flags], - link_args: [wx_libs], + link_args: [wx_libs, link_args], include_directories : include_dirs, dependencies: [wx, taglib, sqlite3, yaml, snd, spdlog], install: true, diff --git a/src/GUI/WaveformViewer.cpp b/src/GUI/WaveformViewer.cpp index 58a7656..2a886ea 100644 --- a/src/GUI/WaveformViewer.cpp +++ b/src/GUI/WaveformViewer.cpp @@ -28,6 +28,7 @@ #include "Utility/Signal.hpp" #include "Utility/Tags.hpp" +#include #include #include @@ -220,7 +221,7 @@ void cWaveformViewer::UpdateWaveformBitmap() } // Actually normalize - for (int i = 0; i < waveform.size(); i++) + for (size_t i = 0; i < waveform.size(); i++) waveform[i] /= normalize; // Draw code @@ -235,7 +236,7 @@ void cWaveformViewer::UpdateWaveformBitmap() SH_LOG_DEBUG("Drawing bitmap.."); - for (int i = 0; i < waveform.size() - 1; i++) + for (size_t i = 0; i < waveform.size() - 1; i++) { float half_display_height = static_cast(display_height) / 2.0f; diff --git a/src/Utility/Log.hpp b/src/Utility/Log.hpp index 31ed10c..ece2918 100644 --- a/src/Utility/Log.hpp +++ b/src/Utility/Log.hpp @@ -22,7 +22,13 @@ #include -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE +#include + +#ifndef SH_BUILD_DEBUG + #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE +#else + #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_OFF +#endif #include