tools:fix build error of incdir in Windows native build

This commit is contained in:
zouboan 2022-11-05 18:10:18 +08:00 committed by Xiang Xiao
parent c8e4adad9f
commit def151869f
2 changed files with 11 additions and 7 deletions

View file

@ -62,7 +62,7 @@ endif
# Define HOSTCC on the make command line if it differs from these defaults
# Define HOSTCFLAGS with -g on the make command line to build debug versions
ifeq ($(CONFIG_WINDOWS_MSYS),y)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
# In the Windows native environment, the MinGW GCC compiler is used

View file

@ -21,8 +21,10 @@
/****************************************************************************
* Included Files
****************************************************************************/
#ifndef CONFIG_WINDOWS_NATIVE
#include <sys/utsname.h>
#endif
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>
@ -115,15 +117,16 @@ static void show_help(const char *progname, int exitcode)
static enum os_e get_os(char *ccname)
{
struct utsname buf;
int ret;
#ifdef CONFIG_WINDOWS_NATIVE
/* Check for MinGW which implies a Windows native environment */
if (strstr(ccname, "mingw") != NULL)
{
return OS_WINDOWS;
}
#else
struct utsname buf;
int ret;
/* Get the context names */
@ -165,8 +168,9 @@ static enum os_e get_os(char *ccname)
{
fprintf(stderr, "ERROR: Unknown operating system: %s\n",
buf.sysname);
return OS_UNKNOWN;
}
#endif
return OS_UNKNOWN;
}
static enum compiler_e get_compiler(char *ccname, enum os_e os)