linux-mingw64-clang config for LLVM MinGW

This commit is contained in:
Nigel Stewart 2025-06-20 15:10:43 +10:00
parent 756229af81
commit dce85d625e
2 changed files with 18 additions and 5 deletions

View File

@ -66,3 +66,14 @@ int __stdcall DllMainCRTStartup(void* instance, unsigned reason, void* reserved)
return 1;
}
#endif
#if defined(_WIN32) && defined(GLEW_BUILD) && defined(__clang__)
/* Windows mingw clang requires a DLL entry point */
int __stdcall _DllMainCRTStartup(void* instance, unsigned reason, void* reserved)
{
(void) instance;
(void) reason;
(void) reserved;
return 1;
}
#endif

View File

@ -1,9 +1,11 @@
# For cross-compiling from Linux to Windows 64-bit using mingw64
# http://mingw-w64.org/
# For cross-compiling from Linux to Windows 64-bit using LLVM MinGW
# https://github.com/mstorsjo/llvm-mingw
#
# Ubuntu/Debian:
# $ sudo apt install mingw-w64
# $ make SYSTEM=linux-mingw64
# $ make SYSTEM=linux-mingw64-clang
#
# Note: It is likely necessary to configure LDFLAGS.GL to reflect the location
# of the Windows link libraries
NAME := glew32
HOST := x86_64-w64-mingw32
@ -12,7 +14,7 @@ CC := $(HOST)-clang
LD := $(HOST)-ld
LN :=
STRIP :=
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 -lmsvcrt
LDFLAGS.GL = -L/opt/llvm-mingw-20250613-msvcrt-ubuntu-22.04-x86_64/x86_64-w64-mingw32/lib -lopengl32 -lgdi32 -luser32 -lkernel32 -lmsvcrt
CFLAGS.EXTRA += -fno-stack-protector -Wno-cast-function-type
WARN = -Wall -W
POPT = -O2