Added support for Ninja in <ccb> (bootstrap). Minor fixes in CMakefiles.

This commit is contained in:
Jean-Paul Chaput 2014-06-10 00:11:42 +02:00
parent 6939025a0d
commit da5fb18971
6 changed files with 30 additions and 26 deletions

View File

@ -1,4 +1,3 @@
# -*- mode:Python -*-
#
# This file is part of the Coriolis Software.
@ -34,6 +33,7 @@ class Builder:
self._rmBuild = False
self._doBuild = True
self._noCache = False
self._ninja = False
self._devtoolset2 = False
self._enableShared = "ON"
self._enableDoc = "OFF"
@ -56,6 +56,7 @@ class Builder:
elif attribute == "rmBuild": self._rmBuild = value
elif attribute == "doBuild": self._doBuild = value
elif attribute == "noCache": self._noCache = value
elif attribute == "ninja": self._ninja = value
elif attribute == "devtoolset2": self._devtoolset2 = value
elif attribute == "enableDoc": self._enableDoc = value
elif attribute == "enableShared": self._enableShared = value
@ -130,6 +131,7 @@ class Builder:
def _execute ( self, command, error ):
if self._devtoolset2 == True:
print 'Using devtoolset-2 (scl enable devtoolset-2 ...)'
commandAsString = ''
for i in range(len(command)):
if i: commandAsString += ' '
@ -160,25 +162,24 @@ class Builder:
print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir )
return
boostNoSystemPaths = 'FALSE'
if self._devtoolset2 == True:
boostNoSystemPaths = 'TRUE'
if self._rmBuild:
print "Removing tool build directory: \"%s\"." % toolBuildDir
command = [ "/bin/rm", "-rf", toolBuildDir ]
self._execute ( command, "Removing tool build directory" )
command = [ 'cmake' ]
if self._ninja: command += [ "-G", "Ninja" ]
if self._devtoolset2: command += [ "-D", "Boost_NO_SYSTEM_PATHS:STRING=TRUE" ]
command += [ "-D", "CMAKE_BUILD_TYPE:STRING=%s" % self.buildMode
, "-D", "BUILD_SHARED_LIBS:STRING=%s" % self.enableShared
#, "-D", "CMAKE_MODULE_PATH:STRING=%s" % cmakeModules
, toolSourceDir ]
if not os.path.isdir(toolBuildDir):
print "Creating tool build directory: \"%s\"." % toolBuildDir
os.makedirs ( toolBuildDir )
os.chdir ( toolBuildDir )
command = ["cmake", "-D", "Boost_NO_SYSTEM_PATHS:STRING=%s" % boostNoSystemPaths
, "-D", "CMAKE_BUILD_TYPE:STRING=%s" % self.buildMode
, "-D", "BUILD_SHARED_LIBS:STRING=%s" % self.enableShared
#, "-D", "CMAKE_MODULE_PATH:STRING=%s" % cmakeModules
, toolSourceDir ]
self._execute ( command, "First CMake failed" )
os.chdir ( toolBuildDir )
@ -186,15 +187,12 @@ class Builder:
cmakeCache = os.path.join(toolBuildDir,"CMakeCache.txt")
if os.path.isfile ( cmakeCache ): os.unlink ( cmakeCache )
command = ["cmake", "-D", "Boost_NO_SYSTEM_PATHS:STRING=%s" % boostNoSystemPaths
, "-D", "CMAKE_BUILD_TYPE:STRING=%s" % self.buildMode
, "-D", "BUILD_SHARED_LIBS:STRING=%s" % self.enableShared
, "-D", "BUILD_DOC:STRING=%s" % self._enableDoc
, "-D", "CHECK_DATABASE:STRING=%s" % self._checkDatabase
, "-D", "CHECK_DETERMINISM:STRING=%s" % self._checkDeterminism
, "-D", "CMAKE_VERBOSE_MAKEFILE:STRING=%s" % self._verboseMakefile
, "-D", "CMAKE_INSTALL_PREFIX:STRING=%s" % self.installDir
]
command += [ "-D", "BUILD_DOC:STRING=%s" % self._enableDoc
, "-D", "CHECK_DATABASE:STRING=%s" % self._checkDatabase
, "-D", "CHECK_DETERMINISM:STRING=%s" % self._checkDeterminism
, "-D", "CMAKE_VERBOSE_MAKEFILE:STRING=%s" % self._verboseMakefile
, "-D", "CMAKE_INSTALL_PREFIX:STRING=%s" % self.installDir
]
if self.libSuffix:
command += [ "-D", "LIB_SUFFIX:STRING=%s" % self.libSuffix ]
command += [ toolSourceDir ]
@ -203,13 +201,15 @@ class Builder:
if self._doBuild:
command = [ "make" ]
if self._ninja:
command = [ "ninja-build" ]
#command += [ "DESTDIR=%s" % self.installDir ]
if self._enableDoc == "ON":
#if tool.name == "crlcore" or tool.name == "stratus1":
if tool.name == "stratus1":
command += [ "dvi", "safepdf", "html" ]
command += self._makeArguments
print "Make command:", command
print "Make/Ninja command:", command
sys.stdout.flush ()
self._execute ( command, "Build failed" )
return

View File

@ -170,6 +170,7 @@ parser.add_option ( "--no-build" , action="store_true" ,
parser.add_option ( "--no-cache" , action="store_true" , dest="noCache" , help="Remove previous CMake cache before building." )
parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove previous build directoty before building." )
parser.add_option ( "--devtoolset-2", action="store_true" , dest="devtoolset2" , help="Build against TUV Dev Toolset 2." )
parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." )
parser.add_option ( "--make" , action="store" , type="string", dest="makeArguments", help="Arguments to pass to make (ex: \"-j4 install\")." )
parser.add_option ( "--project" , action="append" , type="string", dest="projects" , help="The name of a project to build (may appears any number of time)." )
parser.add_option ( "-t", "--tool" , action="append" , type="string", dest="tools" , help="The name of a tool to build (may appears any number of time)." )
@ -240,6 +241,7 @@ else:
if options.noBuild: builder.doBuild = False
if options.noCache: builder.noCache = True
if options.rmBuild: builder.rmBuild = True
if options.ninja: builder.ninja = True
if options.devtoolset2: builder.devtoolset2 = True
if options.makeArguments: builder.makeArguments = options.makeArguments
#if options.svnMethod: builder.svnMethod = options.svnMethod

View File

@ -308,6 +308,7 @@
${CONFIGURATION_LIBRARY}
${CIF_LIBRARY}
${AGDS_LIBRARY}
${UTILITIES_LIBRARY}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QtX_LIBRARIES}

View File

@ -18,7 +18,7 @@
equinox/Strategy.h
equinox/Tile.h equinox/Tiles.h
equinox/UnionFind.h
equinox/SweepLine.h equinox/TileSweepLine.h
equinox/SweepLine.h equinox/TileSweepLine.h
)
set ( mocIncludes equinox/GraphicEquinoxEngine.h )
@ -36,13 +36,13 @@
set ( intervalTreeIncludes intervalTree/src/equinox/Interval.h
intervalTree/src/equinox/IntervalTree.h )
set ( intervalTreeCpps intervalTree/src/IntervalTree.cpp )
qt5_wrap_cpp ( mocCpps ${mocIncludes} )
qt5_wrap_cpp ( mocCpps ${mocIncludes} )
add_library ( intervalTree ${intervalTreeCpps} )
set_target_properties ( intervalTree PROPERTIES VERSION 1.0 SOVERSION 1 )
target_link_libraries ( intervalTree ${HURRICANE_LIBRARIES} )
add_library ( equinox ${cpps} )
add_library ( equinox ${cpps} ${mocCpps} )
set_target_properties ( equinox PROPERTIES VERSION 1.0 SOVERSION 1 )
target_link_libraries ( equinox intervalTree
${CORIOLIS_LIBRARIES}

View File

@ -84,6 +84,7 @@
${BOOKSHELF_LIBRARY}
${CIF_LIBRARY}
${AGDS_LIBRARY}
${UTILITIES_LIBRARY}
${LEFDEF_LIBRARIES}
${COLOQUINTE_LIBRARIES}
${OA_LIBRARIES}

View File

@ -37,9 +37,9 @@
)
qt5_wrap_cpp ( mocCpps ${mocIncludes} )
qt5_wrap_cpp ( mocCpps ${mocIncludes} )
add_library ( solstice ${cpps} )
add_library ( solstice ${cpps} ${mocCpps} )
set_target_properties ( solstice PROPERTIES VERSION 1.0 SOVERSION 1 )
target_link_libraries ( solstice ${EQUINOX_LIBRARIES}
${CORIOLIS_LIBRARIES}