on windows fpc-linking is the funniest of all physfslayer
authorkoda
Mon, 25 Feb 2013 19:48:35 +0100
branchphysfslayer
changeset 8558 e96bf10216ef
parent 8555 342f7af2eea5
child 8561 c3bc61f21874
child 8593 9d1d0fa8db02
on windows fpc-linking is the funniest of all
CMakeLists.txt
hedgewars/uPhysFSLayer.pas
--- a/CMakeLists.txt	Mon Feb 25 10:03:35 2013 +0100
+++ b/CMakeLists.txt	Mon Feb 25 19:48:35 2013 +0100
@@ -306,8 +306,10 @@
     message(STATUS "PhysFS will be provided by the bundled sources")
     set(physfs_output_name "hw_physfs")
     add_subdirectory(misc/libphysfs)
-    #-XLA is a 'beta' fpc flag that will rename libraries before passing them to the linker
-    list(APPEND pascal_flags "-XLAphysfs=${physfs_output_name}")
+    #-XLA is a beta fpc flag that renames libraries before passing them to the linker
+    #we also have to pass PHYSFS_INTERNAL to satisfy windows runtime requirements
+    #(should be harmless on other platforms)
+    list(APPEND pascal_flags "-XLAphysfs=${physfs_output_name}" "-dPHYSFS_INTERNAL")
 endif()
 
 #
--- a/hedgewars/uPhysFSLayer.pas	Mon Feb 25 10:03:35 2013 +0100
+++ b/hedgewars/uPhysFSLayer.pas	Mon Feb 25 19:48:35 2013 +0100
@@ -3,7 +3,7 @@
 interface
 uses SDLh, LuaPas;
 
-const PhysfsLibName = 'libphysfs';
+const PhysfsLibName = {$IFDEF PHYSFS_INTERNAL}'libhw_physfs'{$ELSE}'libphysfs'{$ENDIF};
 const PhyslayerLibName = 'libphyslayer';
 
 {$IFNDEF WIN32}