2
0
Эх сурвалжийг харах

llvm-18: fix windows build error because of include

Laytan Laats 1 жил өмнө
parent
commit
a3821615dc

+ 9 - 5
src/build_settings.cpp

@@ -1,5 +1,3 @@
-#include <llvm/Config/llvm-config.h>
-
 #if defined(GB_SYSTEM_FREEBSD) || defined(GB_SYSTEM_OPENBSD)
 #include <sys/types.h>
 #include <sys/sysctl.h>
@@ -925,10 +923,16 @@ gb_internal isize MAX_ERROR_COLLECTOR_COUNT(void) {
 }
 
 // NOTE: AMD64 targets had their alignment on 128 bit ints bumped from 8 to 16 (undocumented of course).
-#if LLVM_VERSION_MAJOR >= 18
-	#define AMD64_MAX_ALIGNMENT (16)
+#if defined(GB_SYSTEM_WINDOWS)
+	#define AMD64_MAX_ALIGNMENT (8) // TODO: up to 16 when Windows is updated to LLVM 18.
 #else
-	#define AMD64_MAX_ALIGNMENT (8)
+	#include <llvm/Config/llvm-config.h>
+
+	#if LLVM_VERSION_MAJOR >= 18
+		#define AMD64_MAX_ALIGNMENT (16)
+	#else
+		#define AMD64_MAX_ALIGNMENT (8)
+	#endif
 #endif
 
 gb_global TargetMetrics target_windows_i386 = {