-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Minimal CMake
By :

We started by extracting the array
type from our application as it was a simpler piece of functionality to start with. At this point, we’d like to pull out the core Game of Life logic to a separate library. We’re going to make it possible to build it as either a static or shared library, in preparation for potentially integrating it with other languages in the future. This will require us to provide an interface and move the functionality to separate files.
To prepare for our Game of Life code being used as a shared library, we’ll keep the concrete implementation of the Game of Life board hidden and expose functionality through a series of functions. The interface looks as follows:
// forward declare board typedef struct mc_gol_board_t mc_gol_board_t; // lifetime mc_gol_board_t* mc_gol_create_board(int32_t width, int32_t height); void mc_gol_destroy_board(mc_gol_board_t* board); // process void mc_gol_update_board(mc_gol_board_t...