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

commits at source.squeak.org commits at source.squeak.org
Sat Jul 19 14:46:37 UTC 2014


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

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

Name: CMakeVMMakerSqueak-tty.91
Author: tty
Time: 18 July 2014, 12:41:55.549 pm
UUID: 5afe9a2c-10ef-4c92-8341-8c657913ba31
Ancestors: CMakeVMMakerSqueak-tty.90

stage save while upgrading vmmaker.oscog

=============== Diff against CMakeVMMakerSqueak-tty.90 ===============

Item was added:
+ CMakeTemplate subclass: #CMakePluginVm
+ 	instanceVariableNames: 'config definitions module sources includedirectories'
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-CMakeCompositeTemplates'!
+ 
+ !CMakePluginVm commentStamp: 'tty 7/17/2014 11:50' prior: 0!
+ A CMakeVMDriver is a composite template that simplifies outputing vm drivers like vm-display-X11 to a CMakeLists.txt file.
+ I replace the output of pharo's CMakeVMMaker 
+ 
+ CogFamilyUnixConfig addDriver: name sources: aSources generator: cmakeGen externalLibs: extLibs which was invoked like so:
+ 
+ 	aMaker message: 'addVMDrivers: aMaker'.
+ 	 self 
+ 		addDriver: 'vm-display-null' 
+ 		sources: #( 
+ 			'${targetPlatform}/vm-display-null/sqUnixDisplayNull' )
+ 		generator: aMaker
+ 		externalLibs: #();
+ 		!

Item was added:
+ ----- Method: CMakePluginVm>>config (in category 'accessing') -----
+ config
+ 
+ 	^ config!

Item was added:
+ ----- Method: CMakePluginVm>>config:definitions:module:sources:includedirectories: (in category 'accessing') -----
+ config: anObject definitions: dOrderedCollection module: mString sources: sOrderedCollection  includedirectories: iOrderedCollection
+ 	config:= anObject.
+ 	definitions:= dOrderedCollection.
+ 	module := mString.
+ 	sources :=sOrderedCollection.
+ 	includedirectories := iOrderedCollection.
+ 	^self template
+ 
+ !

Item was added:
+ ----- Method: CMakePluginVm>>definitions (in category 'accessing') -----
+ definitions
+ 	^ definitions!

Item was added:
+ ----- Method: CMakePluginVm>>includedirectories (in category 'accessing') -----
+ includedirectories
+ 
+ 	^ includedirectories!

Item was added:
+ ----- Method: CMakePluginVm>>module (in category 'accessing') -----
+ module
+ 
+ 	^ module!

Item was added:
+ ----- Method: CMakePluginVm>>sources (in category 'accessing') -----
+ sources
+ 
+ 	^ sources!

Item was added:
+ ----- Method: CMakePluginVm>>template (in category 'accessing') -----
+ template
+ 	|temp sourcesString cflags|
+ 	cflags:= String streamContents: [:stream | config compilerFlags asStringOn: stream delimiter: ' ' ].
+ 	cflags := '"' , cflags , '"'.
+ 	sourcesString := String streamContents: [:stream | sources asStringOn: stream delimiter: ' ' ].
+ 	temp := OrderedCollection new.
+ 	temp
+ 		addLast: ((CMakeHeader new)  configurationName:  config class name );
+ "		addLast: ((CMakeProject new)variable:  module  ); Ian does not have this. Igor does."
+ 		addLast: ((CMakeMinimumRequired new) version: '3.0.0');
+ 		addLast: ((CMakeInclude new) file: ((config buildDir fullName), FileDirectory slash, 'directories.cmake')) ; 
+ 		addLast:((CMakeAddDefinitions new) definitions: config compilerFlags asOrderedCollection);
+ 		addLast:((CMakeAddDefinitions new) definitions: definitions); 
+ 		addLast:((CMakeSet new) variable:'sources' quotedValue: sourcesString);
+ 		addLast:((CMakeAddLibrary new) 
+ 			library: module
+ 			type: 'SHARED' 
+ 			sources:  sources);
+ 		addLast: ((CMakeIncludeDirectories new) dirs: includedirectories);
+ 		addLast:((CMakeSet new) variable: 'LIBRARY_OUTPUT_PATH' quotedValue: (config outputDir fullName));
+ 		addLast:((CMakeListAppend new) list: 'LINKLIBS' elements: (config externalLibs));
+ 		addLast:((CMakeTargetLinkLibraries new) target: module  items: (OrderedCollection with: '${LINKLIBS}'));
+ 		addLast:((CMakeSetTargetProperties new) 
+ 			target: module 
+ 			propertiesandvalues: (OrderedCollection with: 'PREFIX "" '  with: 'SUFFIX "" ' with: 'LINK_FLAGS ' , cflags)) .
+ 	^temp!

Item was changed:
  ----- Method: CMakeVMDisplayCustom>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-display-custom'!
- 	driver:='vm-display-custom'!

Item was changed:
  ----- Method: CMakeVMDisplayFbdev>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-display-fbdev'!
- 	driver:='vm-display-fbdev'!

Item was changed:
  ----- Method: CMakeVMDisplayNull>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-display-null'!
- 	driver:='vm-display-null'!

Item was changed:
  ----- Method: CMakeVMDisplayQuartz>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-display-Quartz'!
- 	driver:='vm-display-Quartz'!

Item was changed:
  ----- Method: CMakeVMDisplayX11>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-display-X11'!
- 	driver:='vm-display-X11'!

Item was removed:
- CMakeTemplate subclass: #CMakeVMDriver
- 	instanceVariableNames: 'config definitions driver sources includedirectories'
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'CMakeVMMakerSqueak-CMakeCompositeTemplates'!
- 
- !CMakeVMDriver commentStamp: 'tty 7/17/2014 11:50' prior: 0!
- A CMakeVMDriver is a composite template that simplifies outputing vm drivers like vm-display-X11 to a CMakeLists.txt file.
- I replace the output of pharo's CMakeVMMaker 
- 
- CogFamilyUnixConfig addDriver: name sources: aSources generator: cmakeGen externalLibs: extLibs which was invoked like so:
- 
- 	aMaker message: 'addVMDrivers: aMaker'.
- 	 self 
- 		addDriver: 'vm-display-null' 
- 		sources: #( 
- 			'${targetPlatform}/vm-display-null/sqUnixDisplayNull' )
- 		generator: aMaker
- 		externalLibs: #();
- 		!

Item was removed:
- ----- Method: CMakeVMDriver>>config (in category 'accessing') -----
- config
- 
- 	^ config!

Item was removed:
- ----- Method: CMakeVMDriver>>config:definitions:driver:sources:includedirectories: (in category 'accessing') -----
- config: anObject definitions: dOrderedCollection driver: dString sources: sOrderedCollection  includedirectories: iOrderedCollection
- 	config:= anObject.
- 	definitions:= dOrderedCollection.
- 	driver:=dString.
- 	sources :=sOrderedCollection.
- 	includedirectories := iOrderedCollection.
- 	^self template
- 
- !

Item was removed:
- ----- Method: CMakeVMDriver>>definitions (in category 'accessing') -----
- definitions
- 	^ definitions!

Item was removed:
- ----- Method: CMakeVMDriver>>driver (in category 'accessing') -----
- driver
- 
- 	^ driver!

Item was removed:
- ----- Method: CMakeVMDriver>>includedirectories (in category 'accessing') -----
- includedirectories
- 
- 	^ includedirectories!

Item was removed:
- ----- Method: CMakeVMDriver>>sources (in category 'accessing') -----
- sources
- 
- 	^ sources!

Item was removed:
- ----- Method: CMakeVMDriver>>template (in category 'accessing') -----
- template
- 	|temp sourcesString|
- 	sourcesString := String streamContents: [:stream | sources asStringOn: stream delimiter: ' ' ].
- 	temp := OrderedCollection new.
- 	temp
- 		addLast: ((CMakeHeader new)  configurationName:  config class name );
- 		addLast: ((CMakeProject new)variable:  config executableName  );
- 		addLast: ((CMakeInclude new) file: ((config buildDirName), FileDirectory slash, 'directories.cmake')); "??"
- 		addLast:((CMakeAddDefinitions new) definitions: config compilerFlags asOrderedCollection);
- 		addLast:((CMakeAddDefinitions new) definitions: definitions); 
- 		addLast:((CMakeSet new) variable:'sources' quotedValue: sourcesString);
- 		addLast:((CMakeAddLibrary new) 
- 			library: driver
- 			type: 'SHARED' 
- 			sources:  sources);
- 		addLast: ((CMakeIncludeDirectories new) dirs: includedirectories);
- 		addLast:((CMakeSet new) variable: 'LIBRARY_OUTPUT_PATH' quotedValue: (config outputDir fullName));
- 		addLast:((CMakeListAppend new) list: 'LINKLIBS' elements: (config externalLibs));
- 		addLast:((CMakeTargetLinkLibraries new) target: driver  items: (OrderedCollection with: '${LINKLIBS}'));
- 		addLast:((CMakeSetTargetProperties new) 
- 			target: driver 
- 			propertiesandvalues: (OrderedCollection with: 'PREFIX "" '  with: 'SUFFIX "" ' with: 'LINK_FLAGS ' , (config compilerFlags))).
- 	^temp!

Item was changed:
  ----- Method: CMakeVMGeneratorForSqueak>>generateByTemplate (in category 'code generation') -----
  generateByTemplate
  	"attempt to move way from string based writing to  template based. 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;
  		cmakeSharedLinkerFlags;
  		setGlobalOptionsAfterDetermineSystem: self;    
  		setDirectories:  self;
  		cmakeIncludeDirectories:  self;
  		preferredIncludes;
  		standardIncludes;
  		extraVMSettings: self;
  		setCoreSources: self;
  		setPlatformSources: self;
  		setCrossSources: self;
  		setExtraSources;
  		cmakeSetSourceFilesProperties;
  		cmakeListAppend:'LINKLIBS' elements: (config externalLibs);
  		cmakeAddExecutableNameOptionSource: self;
  	      setExecutableOutputPath;
  		addVMPlugins: self.
- 	
- "
- 	self addVMDrivers: aMaker.
- "
  	config templates do: [:each | self puts: each content].
  
  	extPlugins := self generatePluginConfigs: config internalPlugins internal: true.
  	 intPlugins := self generatePluginConfigs: config externalPlugins internal: false.
  	self processThirdpartyLibraries.
  	self processPlugins:  intPlugins, extPlugins.
  
  "	config setExtraTargetProperties: self."
  	self cmd: 'target_link_libraries'
  		params: self moduleName , ' ${LINKLIBS}'.
  	config postBuildActions: self..
  	self saveFile.
  	self generateBuildScript!

Item was changed:
  Object subclass: #CMakeVMPlugin
+ 	instanceVariableNames: 'module sources compilerdefinitions compilerflags externallibraries linkerflags includedirectories'
- 	instanceVariableNames: 'driver sources compilerdefinitions compilerflags externallibraries linkerflags includedirectories'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CMakeVMMakerSqueak-VMPlugins'!
  
  !CMakeVMPlugin commentStamp: 'tty 7/17/2014 19:53' prior: 0!
  A CMakeVMPlugin is a  data bucket for things like:
  
  'vm-display-Quartz' 
  'vm-display-X11'  
  'vm-display-custom'  
  'vm-display-fbdev'  
  'vm-display-null'  
  'vm-sound-ALSA'  
  'vm-sound-MacOSX'  
  'vm-sound-NAS'  
  'vm-sound-OSS'  
  'vm-sound-Sun'  
  'vm-sound-custom'
  'vm-sound-null'
  
  
  
  
  !

Item was removed:
- ----- Method: CMakeVMPlugin>>driver (in category 'accessing') -----
- driver
- 
- 	^ driver!

Item was removed:
- ----- Method: CMakeVMPlugin>>driver: (in category 'accessing') -----
- driver: anObject
- 
- 	driver := anObject!

Item was removed:
- ----- Method: CMakeVMPlugin>>driver:sources:compilerdefinitions:compilerflags:externallibraries:linkerflags:includedirectories: (in category 'accessing') -----
- driver:dString sources:sCollection compilerdefinitions: cdCollection compilerflags: cfCollection externallibraries:elCollection linkerflags: lfCollection includedirectories: idCollection
- 	driver:= dString.
- 	sources:= sCollection.
- 	compilerdefinitions:= cdCollection.
- 	compilerflags:= cfCollection.
- 	externallibraries := elCollection.
- 	linkerflags:= lfCollection.
- 	includedirectories := idCollection.!

Item was added:
+ ----- Method: CMakeVMPlugin>>module (in category 'accessing') -----
+ module
+ 	^module!

Item was added:
+ ----- Method: CMakeVMPlugin>>module: (in category 'accessing') -----
+ module: anObject
+ 
+ 	module := anObject!

Item was added:
+ ----- Method: CMakeVMPlugin>>module:sources:compilerdefinitions:compilerflags:externallibraries:linkerflags:includedirectories: (in category 'accessing') -----
+ module:mString sources:sCollection compilerdefinitions: cdCollection compilerflags: cfCollection externallibraries:elCollection linkerflags: lfCollection includedirectories: idCollection
+ 	module:= mString.
+ 	sources:= sCollection.
+ 	compilerdefinitions:= cdCollection.
+ 	compilerflags:= cfCollection.
+ 	externallibraries := elCollection.
+ 	linkerflags:= lfCollection.
+ 	includedirectories := idCollection.!

Item was changed:
  ----- Method: CMakeVMSoundALSA>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-ALSA'!
- 	driver:='vm-sound-ALSA'!

Item was changed:
  ----- Method: CMakeVMSoundCustom>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-custom'!
- 	driver:='vm-sound-custom'!

Item was changed:
  ----- Method: CMakeVMSoundMacOSX>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-MacOSX'!
- 	driver:='vm-sound-MacOSX'!

Item was changed:
  ----- Method: CMakeVMSoundNAS>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-NAS'!
- 	driver:='vm-sound-NAS'!

Item was changed:
  ----- Method: CMakeVMSoundNull>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-null'!
- 	driver:='vm-sound-null'!

Item was changed:
  ----- Method: CMakeVMSoundOSS>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-OSS'!
- 	driver:='vm-sound-OSS'!

Item was changed:
  ----- Method: CMakeVMSoundSun>>initialize (in category 'initialize-release') -----
  initialize
  	super initialize.
+ 	module :='vm-sound-Sun'!
- 	driver:='vm-sound-Sun'!

Item was changed:
  CPlatformConfig subclass: #CPlatformConfigForSqueak
+ 	instanceVariableNames: 'buildType generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages vmplugins'
- 	instanceVariableNames: 'buildType generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages vmdrivers'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CMakeVMMakerSqueak'!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!
  
  !CPlatformConfigForSqueak commentStamp: 'tty 6/23/2014 17:02' 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 variables.
  
  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 a class instance variable 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
  
  tty.!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>cmakeIncludeDirectories: (in category 'cmake') -----
  cmakeIncludeDirectories: aMaker
  	(enabledebugmessages)
  		ifTrue:[	
  	templates 
  		addLast: ((CMakeMessage new) message: (self class name), ' includeDirs: aMaker' )
  	].
  	templates
  		addLast: ((CMakeIncludeDirectories new) dirs: (OrderedCollection with: (aMaker includeDirs))).
  !

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>fixLineEndsOf: (in category 'squeak compatability') -----
  fixLineEndsOf: string
+ 	self flag:'tty'. "does FileStream handle this cleanly?"
  	^ string copyReplaceAll: String cr with: String crlf!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>initialize (in category 'initialize-release') -----
  initialize
  	enabledebugmessages := false.
  	self initializeVMDrivers.
+ 	self customizeVMPlugins!
- 	self customizeVMDrivers.!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>initializeVMDrivers (in category 'initialize-release') -----
  initializeVMDrivers
+ 	vmplugins := OrderedCollection new.
+ 	vmplugins 
- 	vmdrivers := OrderedCollection new.
- 	vmdrivers 
  		addLast:(CMakeVMDisplayCustom new);
  		addLast:(CMakeVMDisplayFbdev new);
  		addLast:(CMakeVMDisplayNull new);
  		addLast:(CMakeVMDisplayQuartz new);
  		addLast:(CMakeVMDisplayX11 new);
  		addLast:(CMakeVMSoundALSA new);
  		addLast:(CMakeVMSoundCustom new);
  		addLast:(CMakeVMSoundMacOSX new);
  		addLast:(CMakeVMSoundNAS new);
  		addLast:(CMakeVMSoundNull new);
  		addLast:(CMakeVMSoundOSS new);
  		addLast:(CMakeVMSoundSun new).
  !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetProperties: (in category 'cmake buildType redirects') -----
- setExtraTargetProperties: aMaker
- 	"Route this message send to the message appropriate for my buildType "
- 	|d |
- 	d:= SqueakCMakeVMMakerAbstractBuilder default buildTypeAndDirectoryInfo copy.
- 	d 
- 		at: #build put: [self setExtraTargetPropertiesBuild: aMaker];
- 		at: #buildAssert  put: [self setExtraTargetPropertiesBuildAssert: aMaker];
- 		at: #buildAssertITimerHeartbeat  put: [self setExtraTargetPropertiesBuildAssertITimerHeartbeat: aMaker];
-             at:#buildDebug  put: [self setExtraTargetPropertiesBuildDebug: aMaker];   
- 		at: #buildDebugITimerHeartbeat  put: [self setExtraTargetPropertiesBuildDebugITimerHeartbeat: aMaker ];
- 		at: #buildITimerHeartbeat  put: [self setExtraTargetPropertiesBuildITimerHeartbeat: aMaker];
- 		at: #buildMultiThreaded  put: [self setExtraTargetPropertiesBuildMultiThreaded: aMaker ];
- 		at: #buildMultiThreadedAssert  put: [self setExtraTargetPropertiesBuildMultiThreadedAssert: aMaker];
- 		at: #buildMultiThreadedDebug   put: [self setExtraTargetPropertiesBuildMultiThreadedDebug: aMaker ];
- 		at: #buildNone put:[self setExtraTargetPropertiesNoBuildType:  aMaker].
- 	^(d at: buildType) value
- 
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuild: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuild: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildAssert: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildAssert: aMaker 
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildAssertITimerHeartbeat: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildAssertITimerHeartbeat: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildDebug: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildDebug: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildDebugITimerHeartbeat: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildDebugITimerHeartbeat: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildITimerHeartbeat: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildITimerHeartbeat: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildMultiThreaded: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildMultiThreaded: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildMultiThreadedAssert: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildMultiThreadedAssert: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesBuildMultiThreadedDebug: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuildMultiThreadedDebug: aMaker
- 	"convenience method for this buildType.
- 
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setExtraTargetProperties'
- 
- 	do nothing is an option"
- 	self subclassResponsibility
- !

Item was removed:
- ----- Method: CPlatformConfigForSqueak>>setExtraTargetPropertiesNoBuildType: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesNoBuildType: aMaker
- 	"SHOULD NOT GET HERE"
- 	self shouldNotImplement.
- !

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)]
- 				nextPutAll: (self fixLineEndsOf: aContents)] 
  
  !

Item was removed:
- ----- Method: Linux32ARMv6Config>>setExtraTargetPropertiesBuild: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuild: aMaker
- 	self flag:'tty'. "I am nervous about this method up here in this class, but pharo has it in CogUnixConfig, so using as is for now"
- 
- 	aMaker setTargetProperties: 'LINK_FLAGS "-m32"'.
- 		
- 	aMaker puts: 'set_source_files_properties( ${srcVMDir}/cogit.c PROPERTIES 
- 		COMPILE_FLAGS "-O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer -mno-rtd -mno-accumulate-outgoing-args")'.
- 		
- 	
- 	aMaker 
- 		cmd: 'set_source_files_properties'
- 		params: ' ${targetPlatform}/vm/sqUnixHeartbeat.c PROPERTIES 
- 		COMPILE_FLAGS "-O1 -fno-omit-frame-pointer -mno-rtd -mno-accumulate-outgoing-args"'.
- 	aMaker
- 		cmd:'set_target_properties'
- 		params: '${_name} PROPERTIES LINK_FLAGS "-undefined gl"'.
- 
- 
- 	aMaker addExternalLibraries: 
- 		#(
- 			'uuid'  ""
- 			'ssl'  ""
- 			'crypto' ""
- 			'm'  
- 			'dl' 
- 			'pthread' 
- 		).
- 					
- 
- 	aMaker set: 'EXECUTABLE_OUTPUT_PATH' toString: self outputDir fullName.
- 	self addVMPlugins: aMaker.!

Item was removed:
- ----- Method: Linux32x86Config>>setExtraTargetPropertiesBuild: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuild: aMaker
- 	self flag:'tty'. "I am nervous about this method up here in this class, but pharo has it in CogUnixConfig, so using as is for now"
- 
- 	aMaker setTargetProperties: 'LINK_FLAGS "-m32"'.
- 		
- 	aMaker puts: 'set_source_files_properties( ${srcVMDir}/cogit.c PROPERTIES 
- 		COMPILE_FLAGS "-O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer -mno-rtd -mno-accumulate-outgoing-args")'.
- 		
- 	
- 	aMaker 
- 		cmd: 'set_source_files_properties'
- 		params: ' ${targetPlatform}/vm/sqUnixHeartbeat.c PROPERTIES 
- 		COMPILE_FLAGS "-O1 -fno-omit-frame-pointer -mno-rtd -mno-accumulate-outgoing-args"'.
- 	aMaker
- 		cmd:'set_target_properties'
- 		params: '${_name} PROPERTIES LINK_FLAGS "-undefined gl"'.
- 
- 
- 	aMaker addExternalLibraries: 
- 		#(
- 			'uuid'  ""
- 			'ssl'  ""
- 			'crypto' ""
- 			'm'  
- 			'dl' 
- 			'pthread' 
- 		).
- 					
- 
- 	aMaker set: 'EXECUTABLE_OUTPUT_PATH' toString: self outputDir fullName.
- 	self addVMPlugins: aMaker.!

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>addVMPluginsBuild: (in category 'cmake buildType redirects') -----
  addVMPluginsBuild: aMaker
  	|temp o|
  	self flag:'tty'. "I am writing sub-directory CMakeLists.txt here. Should I also write the config.cmake files?"
  	enabledebugmessages
  		ifTrue: [templates  "this message will go to the top level CMakeLists.txt file"
+ 				addLast: (CMakeMessage new message: self class name , 'addVMPluginsBuild: aMaker')].
+ 	vmplugins do:[ :vmp |                    
+ 		o := String new writeStream.   "each VMPlugin gets its own CMakeLists.txt file in its own directory"
- 				addLast: (CMakeMessage new message: self class name , 'addVMDriversBuild:')].
- 	vmdrivers do:[ :vmd |                    
- 		o := String new writeStream.   "each VMDriver gets its own CMakeLists.txt file."
  		temp := OrderedCollection new.	
  		temp
+ 			addAllLast:((CMakePluginVm new)    "this is the CMakeCompositTemplate"
- 			addAllLast:((CMakeVMDriver new)     "<--confusing name. This is a CompositTemplate, not the CMakeVMDriverWrapper class"
  					config: self 
+ 					definitions: (vmp compilerdefinitions)
+ 					module: (vmp module)
+ 					sources: (vmp sources)
+ 					includedirectories: (vmp includedirectories)).
- 					definitions: (vmd compilerdefinitions)
- 					driver: (vmd driver)
- 					sources: (vmd sources)
- 					includedirectories: (vmd includedirectories)).
  		temp do: [:each |  o nextPutAll: (each content); cr].
+ 	((self buildDir) directoryExists: (vmp module))
+ 		ifFalse:[	(self buildDir) createDirectory: (vmp module)].
+ 		self write: (o contents) toFile: vmp module , FileDirectory slash , aMaker outputFileName.
- 	"need a check exists here"
- 		(self buildDir) createDirectory: (vmd driver).
- "		(FileDirectory default) createDirectory: (self buildDir) , FileDirectory slash , vmd driver."
- 		self write: (o contents) toFile: vmd driver , FileDirectory slash , aMaker outputFileName.
  		templates   "this will go to the top level CMakeLists.txt file"
+ 			addLast: ((CMakeAddSubDirectory new) sourcedir: (vmp module)) 
- 			addLast: ((CMakeAddSubDirectory new) sourcedir: (vmd driver)) 
  	].
  
  
  
  
  
  
  
  
  
  !

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>customizeCMakeVMDisplayNull (in category 'plugins') -----
  customizeCMakeVMDisplayNull
+ 	|module|
+ 	module := vmplugins detect: [:vmd | #CMakeVMDisplayNull = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
+ 	module 
- 	|vmdriver|
- 	vmdriver := vmdrivers detect: [:vmd | #CMakeVMDisplayNull = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
- 	vmdriver 
  		sources: #('${targetPlatform}/vm-display-null/sqUnixDisplayNull') ;
  		compilerdefinitions:(OrderedCollection with: '-fPIC' with: '-DPIC');
  		compilerflags: (self compilerFlags);
  		externallibraries: #();
  		linkerflags: (self linkerFlags);
  		includedirectories:(OrderedCollection 
  										with:'${crossDir}/plugins/FilePlugin' 
  										with: '${targetPlatform}/plugins/B3DAcceleratorPlugin'  
   									     with: '${crossDir}/plugins/B3DAcceleratorPlugin').
  	self flag:'tty'. "I don't think includedirectories is correct. revisit"
  
  
  
  
  
  
  !

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>customizeCMakeVMDisplayX11 (in category 'plugins') -----
  customizeCMakeVMDisplayX11
+ 	|module|
+ 	module := vmplugins detect: [:vmd | #CMakeVMDisplayX11 = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
+ 	module 
- 	|vmdriver|
- 	vmdriver := vmdrivers detect: [:vmd | #CMakeVMDisplayX11 = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
- 	vmdriver 
  		sources: #( '${targetPlatform}/vm-display-X11/sqUnixX11'	'${targetPlatform}/vm-display-X11/sqUnixMozilla' );
  		compilerdefinitions:(OrderedCollection with: '-fPIC' with: '-DPIC');
  		compilerflags: (self compilerFlags);
  		externallibraries: (self externalLibraries);
  		linkerflags: (self linkerFlags);
  		includedirectories:(OrderedCollection 
  										with:'${crossDir}/plugins/FilePlugin' 
  										with: '${targetPlatform}/plugins/B3DAcceleratorPlugin'  
   									     with: '${crossDir}/plugins/B3DAcceleratorPlugin').
  !

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>customizeCMakeVMSoundALSA (in category 'plugins') -----
  customizeCMakeVMSoundALSA
+ 	|module|
+ 	module := vmplugins detect: [:vmd | #CMakeVMSoundALSA = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
+ 	module 
- 	|vmdriver|
- 	vmdriver := vmdrivers detect: [:vmd | #CMakeVMSoundALSA = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
- 	vmdriver 
  		sources: #( '${targetPlatform}/vm-sound-ALSA/sqUnixSoundALSA' );
  		compilerdefinitions:(OrderedCollection with: '-fPIC' with: '-DPIC');
  		compilerflags: (self compilerFlags);
  		externallibraries: (self externalLibraries);
  		linkerflags: (self linkerFlags);
  		includedirectories: #().
  	!

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>customizeCMakeVMSoundNull (in category 'plugins') -----
  customizeCMakeVMSoundNull
+ 	|module|
+ 	module := vmplugins detect: [:vmd | #CMakeVMSoundNull = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
+ 	module 
- 	|vmdriver|
- 	vmdriver := vmdrivers detect: [:vmd | #CMakeVMSoundNull = ((vmd class name) asSymbol)] ifNone:[nil].  "error handling?"
- 	vmdriver 
  		sources: #( '${targetPlatform}/vm-sound-null/sqUnixSoundNull' );
  		compilerdefinitions:(OrderedCollection with: '-fPIC' with: '-DPIC');
  		compilerflags: (self compilerFlags);
  		externallibraries: (self externalLibraries);
  		linkerflags: (self linkerFlags);
  		includedirectories:#()
  
  !

Item was removed:
- ----- Method: Linux64x86w32BitConfig>>customizeVMDrivers (in category 'plugins') -----
- customizeVMDrivers
- 	|subset iwantonly|
- 	"trim the vmdrivers ordered collection of CMakeVMDriver subclasses to only those I want. then customize them for use"
- 	iwantonly :=	 #(#CMakeVMDisplayNull  #CMakeVMDisplayX11  #CMakeVMSoundALSA  #CMakeVMSoundNull ).
- 	subset := vmdrivers select: [:vmd | 0 < (iwantonly occurrencesOf: (vmd class name) asSymbol)]. 
- 	vmdrivers := subset.
- 	self 
- 		customizeCMakeVMDisplayNull;
- 		customizeCMakeVMDisplayX11;
- 		customizeCMakeVMSoundALSA;
- 		customizeCMakeVMSoundNull.
- 
- 
- 
- !

Item was added:
+ ----- Method: Linux64x86w32BitConfig>>customizeVMPlugins (in category 'plugins') -----
+ customizeVMPlugins
+ 	|mysubset iwantonly|
+ 	"trim the vmdrivers ordered collection of CMakeVMDriver subclasses to only those I want. then customize them for use on this OS/platform"
+ 	iwantonly :=	 #(#CMakeVMDisplayNull  #CMakeVMDisplayX11  #CMakeVMSoundALSA  #CMakeVMSoundNull ).
+ 	mysubset := vmplugins select: [:vmd | 0 < (iwantonly occurrencesOf: (vmd class name) asSymbol)]. 
+ 	vmplugins := mysubset.
+ 	self 
+ 		customizeCMakeVMDisplayNull;
+ 		customizeCMakeVMDisplayX11;
+ 		customizeCMakeVMSoundALSA;
+ 		customizeCMakeVMSoundNull.
+ 
+ 
+ 
+ !

Item was removed:
- ----- Method: Linux64x86w32BitConfig>>setExtraTargetPropertiesBuild: (in category 'cmake buildType redirects') -----
- setExtraTargetPropertiesBuild: aMaker
- 
- 	
- 	aMaker addExternalLibraries: (self externalLibs).
- 
- 	aMaker set: 'EXECUTABLE_OUTPUT_PATH' toString: self outputDir fullName.
- 	self addVMPlugins: aMaker.!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>cmakeSetSourceFilesPropertiesBuild (in category 'cmake buildType redirects') -----
  cmakeSetSourceFilesPropertiesBuild
  	|cflags|
+ 	cflags:=String streamContents: [:stream | (self compilerFlags) asStringOn: stream 
+ delimiter: ' ' ].
+ 	cflags := '"' , cflags , '"'.
- 	cflags:=String streamContents: [:stream | (self compilerFlags) asStringOn: stream delimiter: ' ' ].
  	(enabledebugmessages)
  		ifTrue:[	templates 
  		addLast:((CMakeMessage new) message: (self class name) , 'cmakeSetSourceFilesPropertiesBuild')
  	] .
  	templates
  		addLast:((CMakeSetSourceFilesProperties new) 
  			files: (OrderedCollection with: '${srcVMDir}/cogit.c') 
  			propertiesandvalues:{'COMPILE_FLAGS' . cflags});
  		addLast:((CMakeSetSourceFilesProperties new) 
  			files: (OrderedCollection with: '${targetPlatform}/vm/sqUnixHeartbeat.c') 
  			propertiesandvalues:{'COMPILE_FLAGS' . cflags}).!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>compilerDefinitions (in category 'compiling') -----
  compilerDefinitions
  	^#(
  	 '-DNDEBUG'                                   
   	 '-DDEBUGVM=0'
+ 	 ' -DLSB_FIRST=1'
  	 '-D_GNU_SOURCE'
   	 '-D_FILE_OFFSET_BITS=64'
  	  '-DUSE_GLOBAL_STRUCT=0'
   	 '-DCOGMTVM=0')
+ !
- 	!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>compilerFlags (in category 'compiling') -----
  compilerFlags
+ 	^#("'-Wall'"
+ 		'-m32'
+ 		'-msse2'
+ 		'-g3'                      "extra debugging info"
+ 		'-O1'
+ 	 	'-fno-caller-saves'
+ 		'-fno-tree-pre')
+ !
- 	^#('-Wall'
- 	    '-m32'
- 	    '-msse2'
- 	    '-g'
- 	   '-O1')
- 	!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>linkerFlags (in category 'compiling') -----
  linkerFlags
  	^#(	'-Wl'
              '-z'
              'now'
+ 	   )
+ !
- 	   )!

Item was changed:
  ----- Method: SqueakUnixConfig>>setDirectories: (in category 'cmake') -----
  setDirectories: aMaker
  	|temp o|
  	"We could put these inline, but other components include the directories.cmake file. So, we continue that convention"
  	o := String new writeStream.
  	temp := OrderedCollection new.
  	temp
  		addLast: ((CMakeSet new) variable: 'topDir' quotedValue: (self topDir fullName));
  		addLast: ((CMakeSet new) variable: 'buildDir' quotedValue: (self buildDir ifNil: ['${topDir}/build'] ifNotNil: [self buildDir fullName]));
  		addLast: ((CMakeSet new) variable: 'thirdpartyDir' quotedValue: '${buildDir}/thirdParty');
  		addLast: ((CMakeSet new) variable: 'platformsDir' quotedValue: (self platformsDir));
  		addLast: ((CMakeSet new) variable: 'srcDir' quotedValue: (self srcDir pathName));
  		addLast: ((CMakeSet new) variable: 'srcPluginsDir' quotedValue: (pluginsDir ifNil: [ '${srcDir}/plugins' ]));
  		addLast: ((CMakeSet new) variable: 'srcVMDir' quotedValue: '${srcDir}/vm');
  		addLast: ((CMakeSet new) variable: 'platformName' quotedValue: (self platformName));
  		addLast: ((CMakeSet new) variable: 'targetPlatform' quotedValue: '${platformsDir}/${platformName}');
  		addLast: ((CMakeSet new) variable: 'crossDir' quotedValue: '${platformsDir}/Cross');
  		addLast: ((CMakeSet new) variable: 'platformVMDir' quotedValue: '${targetPlatform}/vm}');
  		addLast: ((CMakeSet new) variable: 'outputDir' quotedValue: (self outputDir fullName));
  		addLast: ((CMakeSet new) variable: 'externalModulesDir' quotedValue: (self externalModulesDir)).
  	temp do: [:each |  o nextPutAll: (each content); cr].
  	self write: (o contents) toFile: 'directories.cmake'.
  	(enabledebugmessages)
  		ifTrue:[	
  	templates 
  		addLast:((CMakeMessage new) message: (self class name), ' setDirectories: aMaker' )
  	].
  	templates addLast: ((CMakeInclude new) file: 'directories.cmake').
  
  !



More information about the Vm-dev mailing list