BuildingOnMac.wiki
changeset 1976 c764a1bf5795
parent 1975 05c417d4d891
child 1977 12b6619171bb
equal deleted inserted replaced
1975:05c417d4d891 1976:c764a1bf5795
     8 
     8 
     9 == Prerequisites ==
     9 == Prerequisites ==
    10 
    10 
    11 === Required Build Dependencies ===
    11 === Required Build Dependencies ===
    12 
    12 
    13 Homebrew (https://brew.sh/) can be used to gather many of these dependencies, but is not required. All can be found as installers, frameworks, or built manually without Homebrew.
    13 Homebrew ([https://brew.sh/]) can be used to gather many of these dependencies, but is not required. All can be found as installers, frameworks, or built manually without Homebrew.
    14 
    14 
    15 Unless otherwise specified, latest versions of the following dependencies can be used.
    15 Unless otherwise specified, latest versions of the following dependencies can be used.
    16 
    16 
    17 ==== Compilers and Environment ====
    17 ==== Compilers and Environment ====
    18 
    18 
    20   * CMake 3.9 or later
    20   * CMake 3.9 or later
    21   * fpc 2.6.x OR fpc 3.1.1+ (nothing in between, due a crashing bug)
    21   * fpc 2.6.x OR fpc 3.1.1+ (nothing in between, due a crashing bug)
    22 
    22 
    23 ==== Libraries ====
    23 ==== Libraries ====
    24 
    24 
    25 Libraries can be dynamically linked libraries (.dylib) or Apple frameworks (.framework).  All must be on the system library or framework paths for CMake to find them. Frameworks can be put in your home directory at `~/Library/Frameworks`
    25 Libraries can be dynamically linked libraries (`.dylib`) or Apple frameworks (`.framework`). All must be on the system library or framework paths for CMake to find them. Frameworks can be put in your home directory at `~/Library/Frameworks`.
    26 
    26 
    27   * Qt 5.9.x or later (unified installer works)
    27   * Qt 5.9.x or later (unified installer works)
    28   * SDL2
    28   * SDL2
    29   * SDL2_image (2.0.4 works, 2.0.5 might be buggy)
    29   * SDL2_image (2.0.4 works, 2.0.5 might be buggy)
    30   * SDL2_mixer
    30   * SDL2_mixer
    90 
    90 
    91 === Build ===
    91 === Build ===
    92 
    92 
    93 CMake is used to manage the build process, and is run with different flags depending on which optional dependencies you have elected to install.
    93 CMake is used to manage the build process, and is run with different flags depending on which optional dependencies you have elected to install.
    94 
    94 
    95 Take note of where QT is installed; it is a required build flag (see below).
    95 Take note of where Qt is installed; it is a required build flag (see below).
    96 
    96 
    97 Steps to build:
    97 Steps to build:
    98 
    98 
    99 # `cd /path/to/hg/hedgewars/build`
    99 # `cd /path/to/hg/hedgewars/build`
   100 # `cmake .. -DCMAKE_PREFIX_PATH=/Users/user/Qt/5.9.8/clang_64/ -DCMAKE_BUILD_TYPE=Release`
   100 # `cmake .. -DCMAKE_PREFIX_PATH=/Users/user/Qt/5.9.8/clang_64/ -DCMAKE_BUILD_TYPE=Release`
   101 # `make -j2`
   101 # `make -j2`
   102 # `make install`
   102 # `make install`
   103 
   103 
   104 A Hedgewars.app file will be created in the same folder you ran CMake.
   104 A `Hedgewars.app` file will be created in the same folder you ran CMake.
   105 
   105 
   106 To build the DMG, also run:
   106 To build the DMG, also run:
   107 
   107 
   108 # `make dmg`
   108 # `make dmg`
   109 
   109 
   110 ==== Notes ====
   110 ==== Notes ====
   111 
   111 
   112 # To build a debug build, use the flag `-DCMAKE_BUILD_TYPE=Debug` instead of the `Release` one
   112 # To build a debug build, use the flag `-DCMAKE_BUILD_TYPE=Debug` instead of the `Release` one
   113 # To build a minimum-features build, use the additional flags of `-DNOSERVER=1`, `-DNOVIDEOREC=1`, and `-DNOAUTOUPDATE=1`, for disabling of hedgewars-server, video recording, and Sparkle autoupdating, respectively.
   113 # To build a minimum-features build, use the additional flags of `-DNOSERVER=1`, `-DNOVIDEOREC=1`, and `-DNOAUTOUPDATE=1`, for disabling of hedgewars-server, video recording, and Sparkle autoupdating, respectively.
   114 # The build uses CMake BundleUtilities which automatically deploys all libraries and dependencies  into the .app, and repairs the RPATH of each library and binary as needed.  If there is a missing dependency, the `make install` portion of the build will fail. The fix is usually to find the correct .framework and put in on library path, then run `make dmg` again.
   114 # The build uses CMake BundleUtilities which automatically deploys all libraries and dependencies  into the `.app`, and repairs the `RPATH` of each library and binary as needed. If there is a missing dependency, the `make install` portion of the build will fail. The fix is usually to find the correct `.framework` and put in on library path, then run `make dmg` again.
   115 
   115 
   116 Enjoy!
   116 Enjoy!