From b7ade95edcd26059d312f102fcebf415592b622a Mon Sep 17 00:00:00 2001 From: Pxl Date: Sat, 26 Mar 2022 13:09:25 +0800 Subject: [PATCH] Update CMakeLists.txt fix compile fail when windows with llvm+ninja --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cd05ff2..d2077874 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,10 @@ else() set(GODOT_LINKER_FLAGS "-static-libgcc -static-libstdc++ -Wl,-R,'$$ORIGIN'") # Hmm.. maybe to strikt? - set(GODOT_COMPILE_FLAGS "-fPIC -g -Wwrite-strings") + if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + set(GODOT_COMPILE_FLAGS "-fPIC") + endif() + set(GODOT_COMPILE_FLAGS "-g -Wwrite-strings") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wchar-subscripts -Wcomment -Wdisabled-optimization") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wformat -Wformat=2 -Wformat-security -Wformat-y2k") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wimport -Winit-self -Winline -Winvalid-pch")