Adding and removing source-files

From FreeOrionWiki

Jump to: navigation, search

After you added (or removed) a file to the codebase, the project files for MSVC, XCode, the CMakeLists.txt and the SCons build files need to be updated.

Contents

Updating the MSVC project files

If you have MSVC, add the files projects using the GUI, putting them under appropriate filters. The three projects in the solution file are freeorion, the human client; freeoriond, the server; and freeorionca, the ai client. Not all files need to go in all projects - UI code generally goes only the the client, AI stuff only in the ai clients - so only put files where needed.

Updating the SCons build files

In the main freeorion code directory there is a file called SConscript. The is a Python language script that controls the SCons build process. There are four lists of source files:

common_sources contains cpp files that are used by all three executables (human and ai clients, and server)

target_sources is defined to be one of three lists depending on which environment variables are set, which depends on which executable is being built. The cpp files for each executable should be added to the target_sources list after the (clearly-named) environment varibles are checked. For example, files for the server only are added to target_sources after the check for FREEORION_BUILD_SERVER

Updating CMakeLists.txt

(This section needs writing)

Updating XCode Project files

(This section needs writing) Getting help from someone who builds FreeOrion on OSX might help with this.

Updating SVN

After adding source files, and adding them to the project files, you should add all relevant files to SVN, and commit changes to any existing files.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox