workaround for FPC 3.2.2 linking bug
authoralfadur <mail@none>
Sat, 08 Apr 2023 16:45:55 +0300
changeset 15979 668c88b31dd6
parent 15978 4ec24af5909a
child 15980 77f1973611ec
workaround for FPC 3.2.2 linking bug
hedgewars/CMakeLists.txt
hedgewars/hwengine.pas
--- a/hedgewars/CMakeLists.txt	Sat Apr 08 01:44:53 2023 +0300
+++ b/hedgewars/CMakeLists.txt	Sat Apr 08 16:45:55 2023 +0300
@@ -22,6 +22,12 @@
     endif()
 endif(UNIX)
 
+# FPC 3.2.2 does not create s COFF file for the engine icon, but still includes it
+# in the list of files to be linked, leading to a linking failure
+if(${CMAKE_Pascal_COMPILER_VERSION} VERSION_GREATER_EQUAL 3.2)
+    add_flag_append(CMAKE_Pascal_FLAGS "-dSKIP_RESOURCES")
+endif()
+
 # convert list into pascal array
 if(FONTS_DIRS)
   list(LENGTH FONTS_DIRS ndirs)
--- a/hedgewars/hwengine.pas	Sat Apr 08 01:44:53 2023 +0300
+++ b/hedgewars/hwengine.pas	Sat Apr 08 16:45:55 2023 +0300
@@ -19,8 +19,10 @@
 {$INCLUDE "options.inc"}
 
 {$IFDEF WINDOWS}
+{$IFNDEF SKIP_RESOURCES}
 {$R res/hwengine.rc}
 {$ENDIF}
+{$ENDIF}
 
 {$IFDEF HWLIBRARY}
 unit hwengine;