From fcfd681c52b4b6a5a9c26f2ab2c017b44a7e2492 Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Tue, 9 Mar 2010 23:19:39 +0100 Subject: Add switch for enabling physfs build. --- CMakeLists.txt | 7 ++++++- packaging/gentoo/tuxanci-9999.ebuild | 6 ++++-- src/CMakeLists.txt | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73fad62..458ab06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ OPTION (ENABLE_DEBUG "Build debug features" ON) OPTION (DEVELOPER "Modify stuff to please tuxanci devs" OFF) MARK_AS_ADVANCED ( DEVELOPER ) OPTION (WITH_NLS "Build the translations" ON) +OPTION (WITH_PHYSFS "Use physfs engine for unpacking (instead of libzip)" OFF) OPTION (Apple "Build some apple quirks. USE ONLY ON MAC!" OFF) MARK_AS_ADVANCED ( Apple ) OPTION (WITH_OPENGL "Use opengl as renderer instead of SW" ON) @@ -170,7 +171,11 @@ ENDIF ( Apple ) ############################################################################### MESSAGE ( STATUS "" ) FIND_PACKAGE ( PkgConfig REQUIRED ) -pkg_check_modules(ZIP REQUIRED libzip) +IF ( WITH_PHYSFS ) + FIND_PACKAGE ( PhysFS REQURED ) +ELSE ( WITH PHYSFS ) + pkg_check_modules(ZIP REQUIRED libzip) +ENDIF ( WITH PHYSFS ) INCLUDE_DIRECTORIES( ${ZIP_INCLUDE_DIRS} ) IF ( NOT BUILD_SERVER ) # cairo not needed until we start actually using the svg files diff --git a/packaging/gentoo/tuxanci-9999.ebuild b/packaging/gentoo/tuxanci-9999.ebuild index e5bc3fd..5af5965 100644 --- a/packaging/gentoo/tuxanci-9999.ebuild +++ b/packaging/gentoo/tuxanci-9999.ebuild @@ -21,7 +21,7 @@ fi LICENSE="GPL-2" SLOT="0" -IUSE="debug dedicated +ipv6 nls opengl +sound" +IUSE="debug dedicated +ipv6 nls opengl physfs +sound" # >=x11-libs/cairo-1.8.8[X,svg] RDEPEND=" @@ -34,7 +34,8 @@ RDEPEND=" >=media-libs/sdl-mixer-1.2.11[vorbis] ) ) - >=dev-libs/libzip-0.9" + physfs? ( >=dev-games/physfs-2.0.0[zip] ) + !physfs? ( >=dev-libs/libzip-0.9 )" DEPEND="${RDEPEND} dev-util/pkgconfig nls? ( sys-devel/gettext )" @@ -45,6 +46,7 @@ src_configure() { $(cmake-utils_use_build dedicated SERVER) $(cmake-utils_use_with nls) $(cmake-utils_use_with opengl) + $(cmake-utils_use_with physfs) $(cmake-utils_use_enable ipv6) $(cmake-utils_use_enable debug) ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0b9f851..39862f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,6 +57,14 @@ IF ( ENABLE_IPV6 ) ADD_DEFINITIONS ( -DSUPPORT_IPv6 ) ENDIF ( ENABLE_IPV6 ) ############################################################################### +# PHYSFS CHECK +############################################################################### +IF ( WITH_PHYSFS ) + ADD_DEFINITIONS ( -DSUPPORT_LIBPHYSFS ) +ELSE ( WITH_PHYSFS ) + ADD_DEFINITIONS ( -DSUPPORT_LIBZIP ) +ENDIF ( WITH_PHYSFS ) +############################################################################### # AUDIO CHECK ############################################################################### IF ( NOT BUILD_SERVER ) -- cgit v1.2.3