Skip to content

Commit

Permalink
Builder: Branch-specific custom options for CMake
Browse files Browse the repository at this point in the history
The platform_release script now consults the Pilot to see which
branch is being used. This allows specifying different options per
branch, e.g., if the 3rd party dependencies have changed.
  • Loading branch information
skyjake committed Jun 5, 2015
1 parent b6fc2e4 commit 63686c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions distrib/pilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def homeDir():
sys.path.append(homeDir())
import pilotcfg
except ImportError:
print """Configuration needed: pilotcfg.py must be created in ~/.pilot/
if __name__ == '__main__':
print """Configuration needed: pilotcfg.py must be created in ~/.pilot/
pilotcfg.py contains information such as (global variables):
- HOST: pilot server address (for clients)
Expand All @@ -61,7 +62,7 @@ def homeDir():
The function 'postTaskHook(task)' can be defined for actions to be carried out
after a successful execution of a task."""
sys.exit(1)
sys.exit(1)

APP_NAME = 'Doomsday Build Pilot'

Expand Down
9 changes: 7 additions & 2 deletions distrib/platform_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,19 @@ def output_filename(ext='', extra=''):
return 'doomsday_' + extra + DOOMSDAY_VERSION_FULL + "_" + DOOMSDAY_BUILD + ext


def cmake_options_path():
import pilot
return 'cmake.%s.rsp' % pilot.currentBranch()


def cmake_options():
"""Reads the contents of the CMake options file that determines which flags are used
when building a release."""
opts = '-DCMAKE_BUILD_TYPE=Release -DDENG_BUILD=%s ' % (DOOMSDAY_BUILD_NUMBER)
try:
opts += ' ' + open(os.path.join(LAUNCH_DIR, 'cmake.rsp'), 'rt').read().replace('\n', ' ')
opts += ' ' + open(os.path.join(LAUNCH_DIR, cmake_options_path()), 'rt').read().replace('\n', ' ')
except:
print("No additional options provided for CMake (cmake.rsp missing)")
print("No additional options provided for CMake (%s missing)" % cmake_options_path())
return opts


Expand Down

0 comments on commit 63686c9

Please sign in to comment.