Skip to content

Commit

Permalink
Added build option M32 for x86 builds on x64 platforms.
Browse files Browse the repository at this point in the history
By using the new option one may compile a 32-bit version of the game on
64-bit platforms by specifying:
$ cmake -DM32=1

Of course this would require the gcc-multilib package and also 32-bit
versions of libSDL and FMod Ex shared objects.
  • Loading branch information
petarov committed Jun 7, 2013
1 parent 4d9e195 commit bea4773
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Expand Up @@ -135,9 +135,9 @@ if (NOT NO_SOUND)
)

if (NOT FMOD_LIBRARY)
message( STATUS "FModEx lib - ${FMOD_LIB_NAME} not found! Will compile without sound support." )
message(STATUS "FModEx lib - ${FMOD_LIB_NAME} not found! Will compile without sound support.")
else()
message( STATUS "Found FModEx lib at ${FMOD_LIBRARY}. Found FModEx DLL at ${FMOD_LIBRARY_SO_PATH}." )
message(STATUS "Found FModEx lib at ${FMOD_LIBRARY}. Found FModEx DLL at ${FMOD_LIBRARY_SO_PATH}.")

add_definitions(-DWITH_FMOD)
target_link_libraries(savagewheels ${FMOD_LIBRARY})
Expand All @@ -153,7 +153,7 @@ if (NOT NO_SOUND)
endif()

else()
message( STATUS "NO_SOUND option found! Compiling without sound support ..." )
message(STATUS "NO_SOUND option found! Compiling without sound support ...")
endif()

### additional defines
Expand All @@ -162,22 +162,24 @@ if (UNIX AND NOT WIN32)
add_definitions(-DLINUX_BUILD)
endif()

message( STATUS "Build type is ${CMAKE_BUILD_TYPE}" )

message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-g -D_DEBUG -DDEBUG)
else()
add_definitions(-O3 -DNDEBUG)
endif()

if (CMAKE_SIZEOF_VOID_P MATCHES "8")
# set architecture

if (CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT M32)
add_definitions(-DARCH_X64)
set(APP_ARCH "x64")
set(DEB_ARCH "amd64")
else()
add_definitions(-DARCH_X86)
set(APP_ARCH "x86")
set(DEB_ARCH "i386")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
endif()

### configure a header file to pass some of the CMake settings to the source code
Expand Down
14 changes: 12 additions & 2 deletions INSTALL
Expand Up @@ -39,7 +39,7 @@ Extract the downloaded archive 'savagewheels-gamedata.tar.gz' into the bin/ fold
$ ./build.sh

d) Go to the 'release/' subfolder. Extract the produced archive file,
e.g., savagewheels-1.5.0-Linux-x64.tar.gz to your desired Games folder.
e.g., savagewheels-1.5.0-Linux-x64.sh, to your (desired) Games folder.

e) Start the game run:
$ ./savagewheels
Expand All @@ -63,11 +63,21 @@ Extract the downloaded archive 'savagewheels-gamedata.tar.gz' into the bin/ fold
c) Create the installation package with:
$ cpack

Debian/Ubuntu users may also run:
3.2.1) Debian package

Debian/Ubuntu users may run:
$ cpack -G DEB
This will create a .deb package that you can install with, e.g.,
$ dpkg -i savagewheels-1.5.0-Linux-x64.deb

3.2.2) Compile 32-bit version on 64-bit Linux

This requires that you have the 'gcc-multilib' package installed on your system.
You will also need to have 32-bit versions of libSDL.so and fmodex.so.

After all required packages are installed build the makefile by running:
$ cmake -G "Unix Makefiles" ../ -DCMAKE_BUILD_TYPE:STRING=Release -DM32=1

4) Installation on Windows

4.1) Requirements
Expand Down
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -13,8 +13,7 @@ All drivers have background stories which are revealed when playing the campaign

* Please check [HISTORY](HISTORY) for latest changes.
* Please check [INSTALL](INSTALL) for how to compile the game.
* Please check [LICENSE](LICENSE) for licensing (without sound fx).
* Please check LICENSE file in bin/sound folder for sound fx license.
* Please check [LICENSE](LICENSE) for licensing (without sound fx). Check LICENSE file in bin/sound folder for sound fx license.

# Running the game

Expand Down

0 comments on commit bea4773

Please sign in to comment.