and now compile and link properly physfslayer
authorkoda
Fri, 22 Feb 2013 06:39:16 +0100
branchphysfslayer
changeset 8528 ffd71e99a4f0
parent 8526 9f2bd885d773
child 8530 66cedf3e9d1e
and now compile and link properly
CMakeLists.txt
QTfrontend/CMakeLists.txt
hedgewars/CMakeLists.txt
hedgewars/uPhysFSLayer.pas
--- a/CMakeLists.txt	Fri Feb 22 06:38:46 2013 +0100
+++ b/CMakeLists.txt	Fri Feb 22 06:39:16 2013 +0100
@@ -267,15 +267,15 @@
 endif()
 
 
-#physfs library (static on unix, dll on win32)
-find_package(PhysFS)
-if(PHYSFS_FOUND EQUAL FALSE)
-    add_subdirectory(misc/physfs)
+#physfs library and its layer
+if(NOT DEFINED PHYSFS_BUNDLE)
+    find_package(PhysFS)
 endif()
-#    if(NOT WIN32)
-#        list(APPEND pascal_flags "-k${LIBRARY_OUTPUT_PATH}/libphysfs.a")
-#    endif()
-
+if(NOT PHYSFS_FOUND)
+    message(STATUS "PhysFS will be provided by the bundled sources")
+    add_subdirectory(misc/libphysfs)
+endif()
+add_subdirectory(misc/libphyslayer)
 
 #main engine
 add_subdirectory(hedgewars)
--- a/QTfrontend/CMakeLists.txt	Fri Feb 22 06:38:46 2013 +0100
+++ b/QTfrontend/CMakeLists.txt	Fri Feb 22 06:39:16 2013 +0100
@@ -58,7 +58,7 @@
 include_directories(${SDLMIXER_INCLUDE_DIR})
 include_directories(${FFMPEG_INCLUDE_DIR})
 include_directories(${PHYSFS_INCLUDE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/misc/physfs/src)
+include_directories(${PHYSLAYER_INCLUDE_DIR})
 
 
 if(UNIX)
@@ -206,6 +206,7 @@
 
 list(APPEND HW_LINK_LIBS
     ${PHYSFS_LIBRARY}
+    ${PHYSLAYER_LIBRARY}
     ${QT_LIBRARIES}
     ${SDL_LIBRARY}
     ${SDLMIXER_LIBRARY}
--- a/hedgewars/CMakeLists.txt	Fri Feb 22 06:38:46 2013 +0100
+++ b/hedgewars/CMakeLists.txt	Fri Feb 22 06:39:16 2013 +0100
@@ -250,8 +250,12 @@
     add_dependencies(hwengine lua)
 endif()
 
-# compile physfs before engine
-add_dependencies(hwengine physfs)
+# same for physfs
+if(NOT PHYSFS_FOUND)
+    add_dependencies(hwengine physfs)
+endif()
+
+add_dependencies(hwengine physlayer)
 
 #when ffmpeg/libav is found we need to compile it before engine
 #TODO: convert avwrapper to .pas unit so we can skip this step
--- a/hedgewars/uPhysFSLayer.pas	Fri Feb 22 06:38:46 2013 +0100
+++ b/hedgewars/uPhysFSLayer.pas	Fri Feb 22 06:39:16 2013 +0100
@@ -3,19 +3,20 @@
 interface
 uses SDLh, LuaPas;
 
-{$IFDEF ANDROID}
-    {$linklib physfs}
-{$ELSE}
-    {$IFDEF DARWIN}
-        {$LINKFRAMEWORK IOKit}
-    {$ENDIF}
+{$LINKLIB physfs}
+{$LINKLIB physlayer}
+
+{$IFDEF DARWIN}
+    {$LINKFRAMEWORK IOKit}
 {$ENDIF}
 
 const
 {$IFDEF WIN32}
     PhysfsLibName = 'libphysfs';
+    PhyslayerLibName = 'libphyslayer';
 {$ELSE}
     PhysfsLibName = 'physfs';
+    PhyslayerLibName = 'physlayer';
 {$ENDIF}
 
 procedure initModule;