BuildingForIos.wiki
changeset 752 ab1e891cdf63
parent 206 125a79c342d8
child 753 e59a33069c54
equal deleted inserted replaced
751:d9b0213fc1a3 752:ab1e891cdf63
     1 #summary Instructions for building Hedgewars for iOS on Mac OS X
     1 #summary Instructions for building Hedgewars for iOS on Mac OS X
     2 #labels Phase-Implementation,Phase-Deploy,Phase-Support
     2 #labels Phase-Implementation,Phase-Deploy,Phase-Support
     3 
     3 
     4 = Prerequisites =
     4 = Hedgewars for iOS =
       
     5 == Prerequisites ==
     5 
     6 
     6   * XCode must be installed, and you should have some skills in usig it
     7   * XCode must be installed, and you should have some skills in usig it
     7   * We need Mercurial to grab external dependencies
     8   * We need Mercurial to grab external dependencies
     8   * You should be familiar with the BuildingOnMac instructions
     9   * You should be familiar with the BuildingOnMac instructions
     9 
    10 
    10 == Necessary Libraries ==
    11 === Necessary libraries ===
    11 
    12 
    12 The library are exactly the same as usual, but they don't come in a precompiled version; so we will have to download the latest snapshot and build them on our own.
    13 The library are exactly the same as usual, but they don't come in a precompiled version; so we will have to download the latest snapshot and build them on our own.
    13 
    14 
    14 All hard-to-find/hard-to-build libraries are bundled in the source, while SDL and SDL satellites are to be downloaded with HG. For easier handling all libraries come with an Xcode project file so that you just can use the graphical interface to build them; remember to build both Release and Debug for all the Architectures available.
    15 All hard-to-find/hard-to-build libraries are bundled in the source, while SDL and SDL satellites are to be downloaded with HG. For easier handling all libraries come with an Xcode project file so that you just can use the graphical interface to build them; remember to build both Release and Debug for all the Architectures available.
    15 
    16 
    16   * Tremor - misc/libtremor/Xcode - is an ogg variant suited for embedded devices
    17   * Tremor - misc/libtremor/Xcode - is an ogg variant suited for embedded devices
    17   * Freetype - misc/libfreetype/Xcode - is a trimmed down version of the popular font rendering library
    18   * Freetype - misc/libfreetype/Xcode - is a trimmed down version of the popular font rendering library
    18   * Lua - misc/liblua/Xcode - can also be skipped if you specify LUA_DISABLED in hedgewars config.inc file
    19   * Lua - misc/liblua/Xcode - can also be skipped if you specify LUA_DISABLED in hedgewars config.inc file
    19 
    20 
    20 === Compiling SDL for iOS ===
    21 ==== Compiling SDL for iOS ====
    21 
    22 
    22 Since Hedgewars uses all four satellites besides the main SDL library things are going to get difficult. In fact most of the SDL_x libs don't come with a project file and/or can't be easily compiled (without a lot of hacking, that is).
    23 Since Hedgewars uses all four satellites besides the main SDL library things are going to get difficult. In fact most of the SDL_x libs don't come with a project file and/or can't be easily compiled (without a lot of hacking, that is).
    23 
    24 
    24 I'll try to explain what I did here to get my setup working, but in case of doubts or problems you should definitely drop by our IRC channel where we can give better help. Also unfortunately SDL has a high record of breaking during different commits (understandable since SDL1.3 is in beta) so what is written here might not be valid for older releases.
    25 I'll try to explain what I did here to get my setup working, but in case of doubts or problems you should definitely drop by our IRC channel where we can give better help. Also unfortunately SDL has a high record of breaking during different commits (understandable since SDL1.3 is in beta) so what is written here might not be valid for older releases.
    25 
    26 
    33 hg clone http://hg.libsdl.org/SDL_mixer
    34 hg clone http://hg.libsdl.org/SDL_mixer
    34 }}}
    35 }}}
    35 
    36 
    36 Each library has its own iOS project file under the folder Xcode-iOS/; also here you need to build both Release and Debug for all the Architectures available. After this step remeber to update the include paths and linker information in the main Xcode project file.
    37 Each library has its own iOS project file under the folder Xcode-iOS/; also here you need to build both Release and Debug for all the Architectures available. After this step remeber to update the include paths and linker information in the main Xcode project file.
    37 
    38 
    38 == Necessary Tools ==
    39 === Necessary tools ===
    39 
    40 
    40 Besides the iOS SDK, you need a special variant of Freepascal to build the engine as well as the standard Freepascal compiler. So let's download and install (in order):
    41 Besides the iOS SDK, you need a special variant of Freepascal to build the engine as well as the standard Freepascal compiler. So let's download and install (in order):
    41 
    42 
    42   * [http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.6.0/fpc-2.6.0.intel-macosx.dmg/download fpc-intel-macosx]
    43   * [http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.6.0/fpc-2.6.0.intel-macosx.dmg/download fpc-intel-macosx]
    43   * [http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.6.0/fpc-2.6.0.arm-ios.dmg/download fpc-arm-ios]
    44   * [http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.6.0/fpc-2.6.0.arm-ios.dmg/download fpc-arm-ios]
    44 
    45 
    45 The latter one will run a script on its own, let it finish and if no errors are reported, your system is ready! If you get stuck anywhere, luckily there is a full documentation about this process on the [http://wiki.lazarus.freepascal.org/iPhone/iPod_development  Freepascal Wiki]
    46 The latter one will run a script on its own, let it finish and if no errors are reported, your system is ready! If you get stuck anywhere, luckily there is a full documentation about this process on the [http://wiki.lazarus.freepascal.org/iPhone/iPod_development  Freepascal Wiki]
    46 
    47 
    47 = Building process =
    48 == Building process ==
    48 
    49 
    49 And now we should be able to finally open the main Hedgewars.xcodeproj file! There are yet two steps before getting a working build. 
    50 And now we should be able to finally open the main Hedgewars.xcodeproj file! There are yet two steps before getting a working build. 
    50 
    51 
    51    # select the target UpdateDataFolder and hit 'build' (not 'build and run') so the the resources folder gets filled with data; you should do this periodically or when there is new content in the share/hedgewars/Data folder
    52    # select the target UpdateDataFolder and hit 'build' (not 'build and run') so the the resources folder gets filled with data; you should do this periodically or when there is new content in the share/hedgewars/Data folder
    52    # set the proper linking path of all the libries maked in red; the bundled ones should have a correct path, while you need to tell Xcode where are SDL static libraries. In order to do that I suggest that you right click on a red library, press "Get Info", in the "Path" line press 'Choose' and locate the correct xcodeproj file. Luckily this step is done only once.
    53    # set the proper linking path of all the libries maked in red; the bundled ones should have a correct path, while you need to tell Xcode where are SDL static libraries. In order to do that I suggest that you right click on a red library, press "Get Info", in the "Path" line press 'Choose' and locate the correct xcodeproj file. Luckily this step is done only once.