[Vm-dev] VM Maker: CMakeVMMakerSqueak-tty.129.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jun 20 10:47:28 UTC 2016
Timothy M uploaded a new version of CMakeVMMakerSqueak to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMakerSqueak-tty.129.mcz
==================== Summary ====================
Name: CMakeVMMakerSqueak-tty.129
Author: tty
Time: 20 June 2016, 5:53:34.991847 am
UUID: 76d700fa-1db5-4b32-911e-5dd98d003af9
Ancestors: CMakeVMMakerSqueak-tty.128
incremental refactor and addition as I work on the terse guide to Configuration creation
=============== Diff against CMakeVMMakerSqueak-tty.128 ===============
Item was changed:
----- Method: CMakeVMMakerSqueakTutorialNewConfigurationHelp class>>dirBuildLanguageVMMM (in category 'pages') -----
dirBuildLanguageVMMM
^HelpTopic
title:'Specify dirBuildLanguageVMMM'
contents:
'Within the broad outline of this tutorial, you are here:
8. Customizing your Configuration.
SystemNavigation new browseAllImplementorsOf: #dirBuildLanguageVMMM localTo:CPlatformConfigForSqueak.
We scroll down to our Linux64x86w32BitSqueakCogSpurConfig which we copied from the existing Linux64x86w32BitSqueakCogV3Config.
Looking at the dirBuildLanguageVMMM it initially reads (due to the copying of the existing class)
dirBuildLanguageVMMM
^self squeakCogV3
Since this is a configuration for Squeak Cog Spur, I modify the method to return
dirBuildLanguageVMMM
^self squeakCogSpur
As a sanity check, I verify that the method squeakCogSpur exists...
SystemNavigation new browseAllImplementorsOf: #squeakCogSpur
And we see the method exists and will return the string ''squeak.cog.spur''.
(CPlatformConfigForSqueak basicNew) squeakCogSpur
+ The result will be used in two places--in the build directory and the output directory relative to the directories we have specified.
+ The build directory at the platform level now looks like: "oscogvm/cmake.build.linux64x86w32BitCompatibility/squeak.cog.spur/
+ The output directory at the platform level now looks like: "oscogvm/cmake.products/cmake.build.linux64x86w32BitCompatibility/squeak.cog.spur/
+
+
+
+
'!
Item was changed:
----- Method: CMakeVMMakerSqueakTutorialNewConfigurationHelp class>>pages (in category 'accessing') -----
pages
"platformSources...cogitClass...src vs vmsrc"
^#(
overview
tests
identifyPlatform
identifyPlatformAbstractBaseClass
identifyBuilder
createTheConfiguration
excludingConfigFromBuilds
isAbstractBaseClass
isAbstractBaseClassAndExcludeFromBuild
setAvailableBuildTypes
firstCMakeGeneration
tackingStockOne
cPlatformConfigForSqueak
methodRedirectPattern
theVMGenerator
tackingStockTwo
cPlatformConfigForSqueakInitialize
initializePlatformSources
customizePlatformSources
initializeVMPlugins
customizeVMPlugins
configGenerateByTemplate
specifyCogitClass
specifyDirectories
+ specifyTopDir
+ specifyDirOutput
+ specifyDirBuildPlatform
dirBuildLanguageVMMM
setGlobalOptions
cmakePrefixPath
cmakeIncludePath
cmakeLibraryPath
cmakeIncludeModules
cmakeCFlags
cmakeAddDefinitions
cmakeWriteDirectoriesDotCmake
cmakeIncludeDirectories
preferredIncludes
standardIncludes
setGlobalOptionsAfterDetermineSystem
extraVMSettings
setCoreSources
setPlatformSources
setCrossSources
setExtraSources
cmakeSetSourceFilesProperties
cmakeListAppendLINKLIBSelements
cmakeAddExecutableNameOptionSource
setExecutableOutputPath
addVMPlugins
generatePluginConfigs
specifyPlugins
processPlugins
postBuildActions
generateBuildScript
fin
)
!
Item was added:
+ ----- Method: CMakeVMMakerSqueakTutorialNewConfigurationHelp class>>specifyDirBuildPlatform (in category 'pages') -----
+ specifyDirBuildPlatform
+ ^HelpTopic
+ title: 'Specify dirBuildPlatform'
+ contents:
+ 'Within the broad outline of this tutorial, you are here:
+ 8. Customizing your Configuration.
+
+
+ Please evaluate:
+ SystemNavigation new browseAllImplementorsOf: #dirBuildPlatform
+
+ Notice that the CPlatformForSqueak forces subclasses to implement his.
+
+ Looking at the classes that do implement it, notice that they are all at the platform level; i.e. they correspond to the OperatingSystem/Processor the user is compiling for.
+
+ Taking the Linux64x86w32BitConfigUsrLib Confiiguration, we see its implementation of "dirBuildPlatform" returns
+ ^self dirLinux64x86w32BitCompatibility
+
+ SystemNavigation new browseAllImplementorsOf: #dirLinux64x86w32BitCompatibility
+
+ Notice that return value is a "cmake directory string" method in CPlatformConfigForSqueak.
+
+
+ The result will be used in two places--in the build directory and the output directory relative to the directories we have specified.
+
+ The build directory at the platform level now looks like: "oscogvm/cmake.build.linux64x86w32BitCompatibility
+
+ The output directory at the platform level now looks like: "oscogvm/cmake.products/cmake.build.linux64x86w32BitCompatibility
+
+ !!'!
Item was added:
+ ----- Method: CMakeVMMakerSqueakTutorialNewConfigurationHelp class>>specifyDirOutput (in category 'pages') -----
+ specifyDirOutput
+ ^HelpTopic
+ title: 'Specify dirOutput'
+ contents:
+ 'Within the broad outline of this tutorial, you are here:
+ 8. Customizing your Configuration.
+
+ SystemNavigation new browseAllImplementorsOf: #dirOutput
+
+ Here, we see a "cmake directory string" returned.
+
+ The system will use this to create the "oscogvm/cmake.products" directory which will store the compiled VM for your configuration.
+
+ This will rarely, if ever, need customization.
+
+ !!'!
Item was changed:
----- Method: CMakeVMMakerSqueakTutorialNewConfigurationHelp class>>specifyDirectories (in category 'pages') -----
specifyDirectories
+ "This method was automatically generated. Edit it using:"
+ "a HelpBrowser edit: #specifyDirectories"
^HelpTopic
+ title: 'Specify Directories Overview'
+ contents:
- title:'Specify Directories'
- contents:
'Within the broad outline of this tutorial, you are here:
8. Customizing your Configuration.
Our new Configuration must correctly name two directory trees.
The first is the cmake.build.* directory tree where the generated CMake output is placed.
The second is the cmake.products/* directory tree where the compiled vm is placed.
Correctly naming these is a courtesy you should extend as the system grows*.
For this particular Configuration, we want a cmake.build.* directory that looks like this:
oscogvm/cmake.products/cmake.build.linux64x86w32BitCompatibility/squeak.cog.spur
and we want a cmake.products/* directory that looks like this:
oscogvm/cmake.products/cmake.build.linux64x86w32BitCompatibility/squeak.cog.spur/build
+ Each directory in those trees is accessible via the the CPlatformConfigForSqueak method categories: ''cmake directory strings'' and "cmake directory objects"
- Each directory in those trees is accessible viathe the CPlatformConfigForSqueak in the ''cmake directory'' category.
+ ToolSet browseClass: CPlatformConfigForSqueak category: ''cmake directory strings''.
+ ToolSet browseClass: CPlatformConfigForSqueak category: ''cmake directory objects''.
- ToolSet browseClass: CPlatformConfigForSqueak category: ''cmake directory''.
- There are two method variants.
+ Methods in "cmake directory strings" return strings.
+ Methods in "cmake directory objects" return FileDirectory objects.
- The first variant is hardcoded in the method itself. For example the platform directories are stored as...
+
+ In "cmake directory strings" there are two method variants.
+
+ The first variant in "cmake directory strings" is hardcoded in the method itself. For example the platform directories are stored as...
+
dirLinux32Armv6
^''cmake.build.linux32armv6''
or, for our configuration
dirLinux64x86w32BitCompatibility
^''cmake.build.linux64x86w32BitCompatibility''
+ The second variant in "cmake directory strings" accesses the name of a buildType directory via the SqueakCMakeVMMakerAbstractBuilder (do a printIt or doIt).
- The second variant accesses the name of a buildType directory via the SqueakCMakeVMMakerAbstractBuilder (do a printIt or doIt).
dirBuild
^SqueakCMakeVMMakerAbstractBuilder default buildTypeAndDirectoryInfo at: #build
-
-
Each part of the directory tree is contained/accessible via these methods. It is our job to select the corect ones for our purposes.
Here is an example of mapping this output directory path
''oscogvm/cmake.products/cmake.build.linux64x86w32BitCompatibility/squeak.cog.spur/build''
to the methods that output each part.
|c|
c:=(CPlatformConfigForSqueak basicNew).
(c oscogvm), ''/'', (c dirOutput), ''/'', (c dirLinux64x86w32BitCompatibility), ''/'', (c squeakCogSpur), ''/'', (c dirBuild)
The methods corresponding to each of the above directory names are:
topDir
dirOutput
dirBuildPlatform
dirBuildLanguageVMMM
buildType (not a method,this is a private instance variable in the configuration)
The first two, topDir and dirOutput are contained in CPlatformConfigForSqueak
dirBuildPlatform is contained at the platform level
SystemNavigation new browseAllImplementorsOf: #dirBuildPlatform localTo:CPlatformConfigForSqueak.
dirBuildLangaugeVMMM is at the specific Configuration level
SystemNavigation new browseAllImplementorsOf: #dirBuildLanguageVMMM localTo:CPlatformConfigForSqueak.
buildType is set when we configure the Configuration for a particular buildType and is stored in the SqueakCMakeVMMakerAbstractBuilder at its initialization.
SystemNavigation new browseAllImplementorsOf: #initializeBuildTypeAndDirectoryInfo
It is this values that the CPlatformConfigForSqueak access via dirBuild, dirBuildAssert etc...
SystemNavigation new browseAllImplementorsOf: #dirBuild
Similarly, the build directory tree
''oscogvm/cmake.build.linux64x86w32BitCompatibility/squeak.cog.spur/build/''
has methods corresponding to each of the above directory names. they are:
topDir
dirBuildPlatform
dirBuildLanguageVMMM
buildType (not a method,this is a private instance variable in the configuration)
It follows then, that for our Configuration we need to make the method dirBuildLanguageVMMM return ''squeak.cog.spur''.
We cover that in the next Help page.
*The naming convention is straightforward and convered in the ''Naming Convetions'' page of the Developer Guide Overview Help.
+ HelpBrowser openOn: CMakeVMMakerSqueakOverviewHelp) model showTopicThat: [:topic | topic key = #namingConventions].
- (HelpBrowser openOn: CMakeVMMakerSqueakOverviewHelp) model
- showTopicThat: [:topic | topic key = #namingConventions].
+ !!'!
-
- '!
Item was added:
+ ----- Method: CMakeVMMakerSqueakTutorialNewConfigurationHelp class>>specifyTopDir (in category 'pages') -----
+ specifyTopDir
+ ^HelpTopic
+ title: 'Specify TopDir'
+ contents:
+ 'Within the broad outline of this tutorial, you are here:
+ 8. Customizing your Configuration.
+
+ topDir is the root at the top of the build tree and it is fitting it is in the top Configuration.
+
+ SystemNavigation new browseAllImplementorsOf: #topDir
+ SystemNavigation new browseAllImplementorsOf: #oscogvm
+
+ Here, we see a "cmake directory object" and "cmake directory string" used to create a FileDirectory object named ''oscogvm"
+
+ This will rarely, if ever, need customization.
+
+ !!'!
More information about the Vm-dev
mailing list