Skip to content

Commit

Permalink
build: Fix build errors on Windows
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
myd7349 committed Apr 26, 2020
1 parent a49f8ef commit 5bcbd23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).*")
Expand Down
5 changes: 1 addition & 4 deletions src/tools/uchardet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5bcbd23

Please sign in to comment.