commit c0ddcaa95788a9d9e0b259c326de7a213ed5dca9
parent 09d7caaa263be5102d7ed44d8a579537277cb694
Author: Johannes Lorenz <johannes89@ist-einmalig.de>
Date: Thu, 28 Dec 2017 15:41:14 +0100
Fix to match rtosc code moval
No functional changes!
Fix zyn to be compatible with rtosc after code being moved there. This
includes:
* fixing includes
* implementing include-what-you-use support
Diffstat:
4 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/TODO-default-values.txt b/TODO-default-values.txt
@@ -6,9 +6,6 @@ TODOs for default values:
* rEnabled vs rExists:
* clarify/rename
* make a clean function?
-move code:
-* ports.cpp => default_values.cpp
-* rtosc.cpp => ...cmp.cpp?
test:
* zyn fx (all presets)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -180,6 +180,7 @@ endif()
option (BuildForAMD_X86_64 "Build for AMD x86_64 system" OFF)
option (BuildForCore2_X86_64 "Build for Intel Core2 x86_64 system" OFF)
option (BuildForDebug "Include gdb debugging support" OFF)
+option (IncludeWhatYouUse "Check for useless includes" OFF)
set(CMAKE_BUILD_TYPE "Release")
@@ -211,6 +212,19 @@ set (BuildOptionsBasic
set (BuildOptionsDebug
"-std=c++11 -O0 -g3 -ggdb -Wall -Wno-unused-parameter -Wpointer-arith" CACHE STRING "Debug build flags")
+if(${CMAKE_VERSION} VERSION_LESS "3.3.0")
+ set(IwyuErr "disabled (cmake < 3.3.0)")
+else()
+ if(IncludeWhatYouUse)
+ find_program(IwyuPath NAMES include-what-you-use iwyu)
+ if(NOT IwyuPath)
+ set(IwyuErr "package NOT found")
+ endif()
+ else()
+ set(IwyuErr "disabled (IncludeWhatYouUse=OFF)")
+ endif()
+endif()
+
########### Settings dependant code ###########
# From here on, the setting variables have been prepared so concentrate
# on the actual compiling.
@@ -490,6 +504,17 @@ target_link_libraries(zynaddsubfx_core
${PTHREAD_LIBRARY}
rtosc rtosc-cpp)
+if(IwyuErr)
+ message (STATUS "Include what you use: ${IwyuErr}")
+else()
+ set(IwyuPathAndOptions
+ ${IwyuPath}
+ -Xiwyu
+ --no_comments)
+ set_property(TARGET zynaddsubfx_core PROPERTY CXX_INCLUDE_WHAT_YOU_USE
+ ${IwyuPathAndOptions})
+endif()
+
if(CompileTests)
add_subdirectory(Tests)
endif(CompileTests)
diff --git a/src/Misc/Master.h b/src/Misc/Master.h
@@ -17,7 +17,7 @@
#include "../globals.h"
#include "Microtonal.h"
#include <rtosc/automations.h>
-#include <rtosc/ports.h>
+#include <rtosc/savefile.h>
#include "Time.h"
#include "Bank.h"
diff --git a/src/Misc/Schema.cpp b/src/Misc/Schema.cpp
@@ -1,3 +1,4 @@
+#include <cstring>
#include <ostream>
#include <rtosc/ports.h>
using namespace rtosc;