[Vm-dev] VM Maker: CMakeVMMakerSqueak-tty.127.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jun 19 00:21:52 UTC 2016


Timothy M uploaded a new version of CMakeVMMakerSqueak to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMakerSqueak-tty.127.mcz

==================== Summary ====================

Name: CMakeVMMakerSqueak-tty.127
Author: tty
Time: 18 June 2016, 7:27:55.972346 pm
UUID: c8418b7c-0caf-4ddd-979c-4e9d1776947a
Ancestors: CMakeVMMakerSqueak-tty.126

buildDir fix

=============== Diff against CMakeVMMakerSqueak-tty.126 ===============

Item was changed:
  ----- Method: CMakeVMGeneratorForSqueak>>generateByTemplate (in category 'code generation') -----
  generateByTemplate
  	"The bulk of CMake generation happens here.
  	
  	See CPlatformConfigForSqueak>>initialize for CMake output. that occurs prior to this method. (This may change on refactoring)
  
  	Think Seaside renderOn composition.
  	"
  	| extPlugins intPlugins |
  	self flag: 'tty'. "refactor so that the cascade reflects CMake terminilogy"
  	output := String new writeStream.
  	config templates: OrderedCollection new. 
  	config 
  		setGlobalOptions: self;    
  		cmakePrefixPath;
  		cmakeIncludePath;
  		cmakeLibraryPath;
  		cmakeIncludeModules;
  		cmakeCFlags;          
  		cmakeAddDefinitions;
  		cmakeWriteDirectoriesDotCmake:  self;
  		cmakeIncludeDirectories:  self;   "<---"
  		preferredIncludes;                      "<---why 3  of em?"
  		standardIncludes;                       "<---"
  		setGlobalOptionsAfterDetermineSystem: self;    
  		extraVMSettings: self;                "<--catch-all method. os/platform specific"
  		setCoreSources: self;
  		setPlatformSources: self;
  		setCrossSources: self;
  		setExtraSources;
  		cmakeSetSourceFilesProperties;
  		cmakeListAppend:'LINKLIBS' elements: (config externalLibs);
  		cmakeAddExecutableNameOptionSource: self;
  	      setExecutableOutputPath;
  		addVMPlugins: self.
  	config templates do: [:each | self puts: each content].
  	config templates: OrderedCollection new. 
  	extPlugins := self generatePluginConfigs: config internalPlugins internal: true.
  	 intPlugins := self generatePluginConfigs: config externalPlugins internal: false.
  	self flag:'tty: pharo code would download and install libraries. I think detection belongs in CMake and user should set up their own system for squeak. '.
  "	self processThirdpartyLibraries.       "
  	self processPlugins:  intPlugins, extPlugins.
  	self config templates	addLast:((CMakeCommand new) command:'target_link_libraries' params:(self moduleName , ' ${LINKLIBS}')).
  "	self cmd: 'target_link_libraries'
  		params: self moduleName , ' ${LINKLIBS}'."
  	config postBuildActions: self..
  	config templates do: [:each | self puts: each content].
  	self saveFile.
  	self generateBuildScript!

Item was changed:
  Object subclass: #CPlatformConfigForSqueak
+ 	instanceVariableNames: 'buildType cogDir generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages platformSources vmplugins outputDir buildDir topDir'
- 	instanceVariableNames: 'buildType cogDir generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages platformSources vmplugins'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CMakeVMMakerSqueak'!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!
  
  !CPlatformConfigForSqueak commentStamp: 'tty 12/8/2014 11:28' prior: 0!
  A CPlatformConfigForSqueak acts as a compatability layer for Squeak and an Abstract Base Class for extended functionality required for the Squeak CMakeVMMaker use-case.
  
  I make (very) heavy use of a specific design pattern for configuring myself and remaining compatible with pharo's CMakeVMMaker.
  The entry point for that pattern is my method 'configureForBuildType: aSymbol' . Each method send in there detects my buildType and routes the send
  to the approriate method for that buildType.
  
  Subclasses of me 'must' configure themselves for each build type per that pattern. 
  However this can be very easy by just returning the base configuration.
  
  Tests are written to verify that this support infrastructure is in place.
  
  I have two important methods.
  
  excludeFromBuild and isAbstractBaseClass.
  
  excludeFromBuild 
  		is used to exclude a configuration from being built by a Builder.
  		is used to exclude a configuration from Testing.
  
  isAbstractBaseClass 
  		is used by configurations that exclude themselves from being built by a Builder BUT need to be included in 		Testing.
  
  										
  excludeFromBuild  | isAbstractBaseClass  | should build  | should test
  	T					    T                            NO                  YES
        T					    F                             NO                   NO
        F					    T                            YES                  YES
        F                                 F                            YES                  YES
  
  
  The use-case is as follows.
  
  An abstract base class contains a lot of functionality that must be implemented and tested for the system to work, but it is not meant to be compiled.
  
  concrete classes of that AbstractBase class can exclude themselves from being built by builders and by doing so are not tested.
  However, once a concrete configuration is enabled to be built, it must pass all tests.
  
  Linux32x86Config is an example of an AbstractBase class that must pass all testing, but is not buildable.
  Its subclass Linux32x86SqueakCogV3Config needs testing, but a developer can toggle 'exclude from build' to hide it from Builders or make it available to them.
  
  Tests make the decision on what configurations to test. Here are some examples.
  	(o excludeFromBuild not) & (configuration isAbstractBaseClass not)  this is a concrete [Lang][VM][MemoryManager][etc] configuration that will be built. No platform classes considered
  	(o excludeFromBuild) & (configuration isAbstractBaseClass not)         This is a concrete [Lang][VM][MemoryManager][etc] configuration that will be NOT built.
  	(o excludeFromBuild not) | (configuration isAbstractBaseClass)          concrete implementation may depend on its [OS][VMWordSize][Processor] AbstractBaseClass for platform level methods. 
  																		   example: Linux32x86Config ccBuild has the '-m32' compiler flag that is common to all builds on that platform
  	(o excludeFromBuild not) & (configuration isAbstractBaseClass)       Not allowed. [OS][VMWordSize][Processor] AbstractBaseClasses should not be built. This is a useful test in its own right.
  	(o excludeFromBuild) & (configuration isAbstractBaseClass)             These are the AbstractBaseClasses. An AbstractBaseClass should always be excluded from a build
  
  
  HelpBrowser openOn: CMakeVMMakerSqueakDeveloperHelp
  tty.!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>buildDir (in category 'cmake directory') -----
  buildDir
+ 	^ buildDir ifNil: [ buildDir := ( self topDir / self buildDirName) assureExistence]. !
- 	^ buildDir ifNil: [ buildDir := ( self topDir / self buildDirName) assureExistence].!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>outputDir (in category 'cmake directory') -----
  outputDir
  	"the directory where built binaries will be stored"
+ 	^ outputDir ifNil: [ outputDir := (self topDir / self dirOutput / self dirBuildPlatform / self dirBuildLanguageVMMM / (buildType asString)) ]	 
- 	^ outputDir ifNil: [ outputDir := (self topDir / self dirOutput / self dirBuildPlatform / self dirBuildLanguageVMMM / (buildType asString)) ]	
  
  !

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>topDir (in category 'cmake directory') -----
  topDir
    " topDir=oscogvm
      dirSource=[nsspur64src | nsspursrc |nsspurstack64src |nsspurstacksrc |spur64src |spursistasrc |spursrc | spurstack64src |spurstacksrc | src |stacksr]  Configurations customize this
      srcDir=oscogvm/dirSource
      cogDir=oscogvm/src   (needed by CMake for access to plugins source in oscogvm/src/plugins)
  "
+ 	^ topDir ifNil: [ topDir := FileDirectory default directoryNamed: self oscogvm ] 
- 	^ topDir ifNil: [ topDir := FileDirectory default directoryNamed: self oscogvm ]
  	!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>write:toFile: (in category 'squeak compatability') -----
  write: aContents toFile: aFileName
  	"write a file to current output directory (buildDir).
  	use line end convention appropriate for config platform"
  	| bldDir |
  	bldDir := self buildDir.
  	bldDir isString
  		ifTrue: [ bldDir := FileDirectory directoryEntryFor: bldDir ].
  	bldDir assureExistence.
  	bldDir
  		forceNewFileNamed: aFileName
  		do: [:s | s
  				nextPutAll: (self fixLineEndsOf: aContents)]
  
  !



More information about the Vm-dev mailing list