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.
This commit is contained in:
myd7349 2020-02-17 02:11:11 +00:00
parent a49f8ef6ea
commit 5bcbd23acf
2 changed files with 2 additions and 5 deletions

View File

@ -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).*")

View File

@ -35,12 +35,9 @@
*
* ***** END LICENSE BLOCK ***** */
#include "../uchardet.h"
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <getopt.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef VERSION