[Vm-dev] VM Maker: CMakeVMMaker-EstebanLorenzano.176.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Sep 5 18:14:14 UTC 2012


Esteban Lorenzano uploaded a new version of CMakeVMMaker to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMaker-EstebanLorenzano.176.mcz

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

Name: CMakeVMMaker-EstebanLorenzano.176
Author: EstebanLorenzano
Time: 5 September 2012, 8:13:57.119 pm
UUID: 390372d5-ca3c-4829-9c94-128a3c62881a
Ancestors: CMakeVMMaker-IgorStasenko.175

- changes for iOS and freetype2

=============== Diff against CMakeVMMaker-IgorStasenko.175 ===============

Item was changed:
+ ----- Method: CMFreetype2 class>>canonicalName (in category 'accessing') -----
- ----- Method: CMFreetype2 class>>canonicalName (in category 'as yet unclassified') -----
  canonicalName
  	^ 'freetype2'!

Item was added:
+ CMOSXFreetype2 subclass: #CMIOSFreetype2
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMaker-Libs'!

Item was added:
+ ----- Method: CMIOSFreetype2>>copyArtefacts (in category 'generating actions') -----
+ copyArtefacts
+ 
+ 	gen puts:
+ 'add_custom_command(
+ 	OUTPUT "${externalModulesDir}/${libraryFileName}"
+ 	DEPENDS "${ft2libInstalled}"
+ )'!

Item was added:
+ ----- Method: CMIOSFreetype2>>defineGlobalTargets (in category 'generating actions') -----
+ defineGlobalTargets
+ 	| var |
+ 	var := self canonicalName , '_LIB'.
+ 	vmGen set: var toString: self libraryFileName.
+ "
+ define a library as imported one
+ and make it depend from it's build target
+ "
+ 	vmGen
+ 		puts: 
+ ('add_library("{1}" STATIC IMPORTED GLOBAL)
+ 	set_target_properties("{1}" PROPERTIES IMPORTED_LOCATION "{1}")
+ add_dependencies("{1}" "{2}")
+ ' format: { '${',var, '}' . self buildTarget }
+ ).
+ 
+ 	vmGen cmd: 'add_dependencies' params:
+ 		vmGen moduleName , ' ' , self buildTarget!

Item was added:
+ ----- Method: CMIOSFreetype2>>libraryFileName (in category 'package properties') -----
+ libraryFileName 
+ 	^'libfreetype.a'!

Item was added:
+ ----- Method: CMIOSFreetype2>>targetForLinking (in category 'exports') -----
+ targetForLinking
+ 	"Answer a target or path to library to link with, which can be used by 
+ 	external plugins or VM module"
+ 
+ 	^ '${ft2libInstalled}/', self libraryFileName!

Item was changed:
+ ----- Method: CMOSXFreetype2 class>>platformName (in category 'accessing') -----
- ----- Method: CMOSXFreetype2 class>>platformName (in category 'as yet unclassified') -----
  platformName 
  	^'iOS'!

Item was added:
+ ----- Method: CMOSXFreetype2 class>>supports: (in category 'as yet unclassified') -----
+ supports: aConfig 
+ 	^self = aConfig freetypeLibClass!

Item was changed:
+ ----- Method: CMThirdpartyLibrary class>>canonicalName (in category 'accessing') -----
- ----- Method: CMThirdpartyLibrary class>>canonicalName (in category 'as yet unclassified') -----
  canonicalName
  	"answer the library canonical name, like 
  		'freetype2'
  		or 'cairo' 
  		etc.
  		
  	Note , this method is used to find the corresponding library
  	from all subclasses of CMThirdpartyLibrary	
  	"
  	^ self subclassResponsibility!

Item was changed:
+ ----- Method: CMThirdpartyLibrary class>>named:config: (in category 'instance creation') -----
- ----- Method: CMThirdpartyLibrary class>>named:config: (in category 'as yet unclassified') -----
  named: aName config: aCPlatformConfig
  
  	^ (self allSubclasses detect: [:cls | 
  		cls canonicalName = aName and: [ cls supports: aCPlatformConfig ] ])
  		new!

Item was changed:
+ ----- Method: CMThirdpartyLibrary class>>platformName (in category 'accessing') -----
- ----- Method: CMThirdpartyLibrary class>>platformName (in category 'as yet unclassified') -----
  platformName 
  	^nil!

Item was changed:
  ----- Method: CPlatformConfig>>addThirdpartyLibrary: (in category 'thirdparty libs') -----
  addThirdpartyLibrary: libName
  	| libs lib |
  	
  	libs := self thirdpartyLibs.
  	
+ 	lib :=  libs 
+ 		detect: [:each | each canonicalName = libName and: [ each supports: self ] ] 
+ 		ifNone: [ nil ].
+ 		
+ 	lib ifNil: [ 
- 	lib :=  libs detect: [:each | each canonicalName = libName] ifNone: [ nil ].
- 	
- 	lib ifNil: [
  		lib := (CMThirdpartyLibrary named: libName config: self).
+ 			"add dependencies first, so thirpartyLibs collection will be naturally dependency sorted"
+ 			lib dependencies do: [:dep | self addThirdpartyLibrary: dep ].
+ 			libs add: lib ].
+ 
- 		"add dependencies first, so thirpartyLibs collection will be naturally dependency sorted"
- 		lib dependencies do: [:dep | self addThirdpartyLibrary: dep ].
- 		libs add: lib.
- 		].
- 	
  	^ lib!

Item was added:
+ ----- Method: CocoaIOSConfig>>freetypeLibClass (in category 'accessing') -----
+ freetypeLibClass 
+ 	^CMOSXFreetype2!

Item was changed:
  ----- Method: StackIPhoneConfig>>architecture (in category 'accessing') -----
  architecture 
+ 	^'armv7'!
- 	^'armv6'!

Item was changed:
  ----- Method: StackIPhoneConfig>>configureFT2Plugin: (in category 'plugin extra rules') -----
  configureFT2Plugin: maker
  	"extra rules for Freetype plugin.
  	a custom rule to build freetype library"
  	| lib devRoot sdkRoot |
  	
+ 	"maker isExternal 
+ 		ifFalse: [ self error: 'building internal FT2Plugin is not supported yet' ]."
- 	maker isExternal 
- 		ifFalse: [ self error: 'building internal FT2Plugin is not supported yet' ].
  
  	devRoot := '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer'.
  	sdkRoot := '{devRoot}/SDKs/iPhoneOS{sdkVersion}.sdk' 
  		nameFormat: {'devRoot'->devRoot. 'sdkVersion'->self sdkVersion} asDictionary.
  
  	"add freetype library into loop"
  	lib := self addThirdpartyLibrary: 'freetype2'.
  	lib configurationFlags: ({
+ 		'--without-zlib'.
+ 		'--without-bzip2'.
   		'--host=arm-apple-darwin'.
  		'--enable-static=yes'. 
+ 		'--enable-shared=no'.
- 		'--enable-shared=yes'.
  		'CC={devRoot}/usr/bin/gcc'.
  		'CXX={devRoot}/usr/bin/g++'.
+ 		'CFLAGS=\\"-arch armv7 -std=c99 -Wno-trigraphs -O2 -fwrapv -Wreturn-type -Wunused-variable -fmessage-length=0 -miphoneos-version-min=4.0 -I{sdkRoot}/usr/include/libxml2 -isysroot {sdkRoot}\\"'.
+ 		'LDFLAGS=\\"-arch armv7 -isysroot {sdkRoot}\\"'}
- 		"'AR={devRoot}/usr/bin/ld'."
- 		'CFLAGS=\\"-arch armv6 -std=c99 -Wno-trigraphs -O2 -fwrapv -Wreturn-type -Wunused-variable -fmessage-length=0 -miphoneos-version-min=4.0 -I{sdkRoot}/usr/include/libxml2 -isysroot {sdkRoot}\\"'.
- 		'LDFLAGS=\\"-arch armv6 -isysroot {sdkRoot}\\"'}
  		collect: [ :each | each nameFormat: {'sdkRoot'->sdkRoot. 'devRoot'->devRoot} asDictionary ]).
  
  	"maker set: 'XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR' toString: ''."
  
  	"link plugin with freetype lib"
+ 	maker addExternalLibrary: '${thirdpartyDir}/out/lib/', lib libraryFileName.
- 	maker addExternalLibrary: lib targetForLinking.
  	maker includeDirectories: lib includeDir.
  !

Item was added:
+ ----- Method: StackIPhoneConfig>>freetypeLibClass (in category 'accessing') -----
+ freetypeLibClass 
+ 	^CMIOSFreetype2!



More information about the Vm-dev mailing list