Skip to content

Build Instructions

Hao Sun edited this page Mar 7, 2017 · 4 revisions

This project use CMake for managing sources and compile them.

There's a build script wrapping around some common practice of the use of CMake, and arranging those modules in the project.

Initialise code completion(not necessary):

sudo ./build_mahjong.sh --update-code-completion
. /etc/bash_completion.d/build_mahjong.sh

Build Mahjong Lib:

./build_mahjong.sh --lib

Build and run Mahjong Lib Unit Test:

./build_mahjong.sh --lib test

Build Players:

./build_mahjong.sh --player [user | dumb]

Options:

User Input Player:

user

Dumb AI Players:

dumb

Build Games:

./build_mahjong.sh --game [simple]

Options:

Simple Mahjong Game:

simple

Print help messages:

./build_mahjong.sh --help

GTest Install Instructions

Run sudo first(to cache the authentication).

sudo whoami

Then run through(can copy & paste entire block if sudo is not requiring password) the following script.

git clone https://github.com/google/googletest.git
mkdir -p gtest_build
cd gtest_build
cmake ../googletest
make
sudo make install
cd ..
rm -rf ./googletest ./gtest_build