From 4b1c7c7f0a81cdcfda4f1b57a0606014970d0cc8 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 7 Jun 2021 21:56:13 +0200 Subject: [PATCH] Update to make compilation work with NanoSVG as a Git subtree. --- CMakeLists.txt | 8 ++------ es-core/src/resources/TextureData.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b106aa23..777767ee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,7 +231,7 @@ set(COMMON_INCLUDE_DIRS ${RAPIDJSON_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${VLC_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/external + ${CMAKE_CURRENT_SOURCE_DIR}/external/nanosvg/src ${CMAKE_CURRENT_SOURCE_DIR}/es-core/src) # For Windows we need to add local include files for the dependency packages. @@ -292,8 +292,7 @@ if(NOT WIN32) ${FREETYPE_LIBRARIES} ${PUGIXML_LIBRARIES} ${SDL2_LIBRARY} - ${VLC_LIBRARIES} - nanosvg) + ${VLC_LIBRARIES}) elseif(WIN32) if(DEFINED MSVC) set(COMMON_LIBRARIES @@ -311,7 +310,6 @@ elseif(WIN32) "${PROJECT_SOURCE_DIR}/SDL2main.lib" "${PROJECT_SOURCE_DIR}/libvlc.lib" "${PROJECT_SOURCE_DIR}/SDL2.lib" - "nanosvg" "Winmm.dll") else() set(COMMON_LIBRARIES @@ -330,7 +328,6 @@ elseif(WIN32) "${PROJECT_SOURCE_DIR}/libvlc.dll" "${PROJECT_SOURCE_DIR}/SDL2.dll" "mingw32" - "nanosvg" "Winmm.dll") endif() endif() @@ -388,6 +385,5 @@ set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE) set(LIBRARY_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE) # Add each component. -add_subdirectory("external") add_subdirectory("es-core") add_subdirectory("es-app") diff --git a/es-core/src/resources/TextureData.cpp b/es-core/src/resources/TextureData.cpp index c195fc000..1f8b020cd 100644 --- a/es-core/src/resources/TextureData.cpp +++ b/es-core/src/resources/TextureData.cpp @@ -6,6 +6,9 @@ // Low-level texture data functions. // +#define NANOSVG_IMPLEMENTATION +#define NANOSVGRAST_IMPLEMENTATION + #include "resources/TextureData.h" #include "math/Misc.h" @@ -14,9 +17,8 @@ #include "ImageIO.h" #include "Log.h" -#include -#include -#include +#include +#include #include #define DPI 96