Skip to content

Commit 82e2018

Browse files
committed
Fix CMakeLists.txt for LLVM Windows build
1 parent 5359553 commit 82e2018

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

compat/vcbuild/include/sys/utime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ struct _utimbuf
2222
time_t modtime; /* Modification time */
2323
};
2424

25+
#ifndef _NO_OLDNAMES
2526
/* NOTE: Must be the same as _utimbuf above. */
2627
struct utimbuf
2728
{
2829
time_t actime;
2930
time_t modtime;
3031
};
32+
#endif /* Not _NO_OLDNAMES */
3133

3234
#endif

compat/vcbuild/include/unistd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
#ifndef _MODE_T_
77
#define _MODE_T_
88
typedef unsigned short _mode_t;
9+
10+
#ifndef _NO_OLDNAMES
911
typedef _mode_t mode_t;
12+
#endif
1013
#endif /* Not _MODE_T_ */
1114

1215
#ifndef _SSIZE_T_

contrib/buildsystems/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ to avoid this, add `-DNO_VCPKG=TRUE` to the command line when configuring.
4949
]]
5050
cmake_minimum_required(VERSION 3.14)
5151

52-
# TODO wrap this in the right conditions (only when using LLVM MinGW Windows)
53-
add_compile_definitions(_NO_OLDNAMES)
54-
5552
#set the source directory to root of git
5653
set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
5754

@@ -261,7 +258,7 @@ endif()
261258

262259
#Platform Specific
263260
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
264-
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
261+
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR (NOT CMAKE_GENERATOR STREQUAL "MinGW Makefiles" AND CMAKE_C_COMPILER_ID STREQUAL "Clang"))
265262
include_directories(${CMAKE_SOURCE_DIR}/compat/vcbuild/include)
266263
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
267264
endif()

0 commit comments

Comments
 (0)