From 5bcbd23acfe20c13fe641b589b7ed8701d9e90a4 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Mon, 17 Feb 2020 02:11:11 +0000 Subject: [PATCH] build: Fix build errors on Windows - Fix string no output variables on UWP On UWP, CMAKE_SYSTEM_PROCESSOR may be empty. As a result: string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE) will be treated as: string(TOLOWER TARGET_ARCHITECTURE) which, as a result, will cause a CMake error: CMake Error at CMakeLists.txt:42 (string): string no output variable specified - Remove unnecessary header inclusions in uchardet.cpp These extra inclusions cause build errors on Windows. --- CMakeLists.txt | 2 +- src/tools/uchardet.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d2038d..fcf3006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ if (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) if (TARGET_ARCHITECTURE STREQUAL "") - string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE) + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" TARGET_ARCHITECTURE) endif (TARGET_ARCHITECTURE STREQUAL "") if (TARGET_ARCHITECTURE MATCHES ".*(x86)|(amd).*") diff --git a/src/tools/uchardet.cpp b/src/tools/uchardet.cpp index c6bf5f4..3952e61 100644 --- a/src/tools/uchardet.cpp +++ b/src/tools/uchardet.cpp @@ -35,12 +35,9 @@ * * ***** END LICENSE BLOCK ***** */ #include "../uchardet.h" -#include -#include -#include #include -#include #include +#include #include #ifndef VERSION