[Vm-dev] VM Maker: CMakeVMMaker-IgorStasenko.175.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Aug 1 21:50:47 UTC 2012
Igor Stasenko uploaded a new version of CMakeVMMaker to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMaker-IgorStasenko.175.mcz
==================== Summary ====================
Name: CMakeVMMaker-IgorStasenko.175
Author: IgorStasenko
Time: 1 August 2012, 11:50:31.519 pm
UUID: ebc47994-4eb0-7c4f-977b-bde45aced54e
Ancestors: CMakeVMMaker-EstebanLorenzano.174
- merge with .174
- FT2Plugin now can be build with freetype2 library,
without need to have external scripts in platform sources.
(everything is done by cmake)
- FT2Plugin can now be built as internal on windows
=============== Diff against CMakeVMMaker-EstebanLorenzano.174 ===============
Item was changed:
----- Method: CMFreetype2>>copyArtefacts (in category 'generating actions') -----
copyArtefacts
gen puts:
'add_custom_command(
OUTPUT "${externalModulesDir}/${libraryFileName}"
+ COMMAND cp "${ft2libInstalled}" "${externalModulesDir}/${libraryFileName}"
- COMMAND cp ${installPrefix}/lib/${libraryFileName} ${externalModulesDir}/${libraryFileName}
DEPENDS "${ft2libInstalled}"
)'!
Item was added:
+ CMFreetype2 subclass: #CMWin32Freetype2
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'CMakeVMMaker-Libs'!
+
+ !CMWin32Freetype2 commentStamp: '<historical>' prior: 0!
+ Some overrides to make freetype build on windows:
+
+ Two artifacts to copy:
+
+ libfreetype.dll.a
+ libfreetype-6.dll
+
+ the first one is used at link time with FTPlugin to
+ designate the exported symbols of .dll as well as .dll file name.
+
+ The second one is ready to use library produced by freetype makefiles.
+
+ We pass
+
+ -march=i686
+
+ instead of
+
+ -arch i386
+
+ to freetype configure, because MSYS GCC on windows don't understands the -arch option.
+ !
Item was added:
+ ----- Method: CMWin32Freetype2 class>>platformName (in category 'as yet unclassified') -----
+ platformName
+ ^'win32'!
Item was added:
+ ----- Method: CMWin32Freetype2>>copyArtefacts (in category 'generating actions') -----
+ copyArtefacts
+
+ gen puts:
+ 'add_custom_command(
+ OUTPUT "${externalModulesDir}/${libraryFileName}"
+ COMMAND cp "${ft2libInstalled}" "${externalModulesDir}"
+ COMMAND cp "${ft2binInstalled}" "${externalModulesDir}"
+ DEPENDS "${ft2libInstalled}"
+ )'!
Item was added:
+ ----- Method: CMWin32Freetype2>>defaultConfigurationFlags (in category 'settings') -----
+ defaultConfigurationFlags
+ ^#(
+ 'CFLAGS=''-march=i686'''
+ 'LDFLAGS=''-march=i686''')!
Item was added:
+ ----- Method: CMWin32Freetype2>>defineGlobalTargets (in category 'generating actions') -----
+ defineGlobalTargets
+ | var |
+ var := self canonicalName , '_LIB'.
+ vmGen set: var toString: self targetForLinking.
+ "
+ 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: CMWin32Freetype2>>libraryFileName (in category 'package properties') -----
+ libraryFileName
+ ^ 'libfreetype.dll.a'!
Item was added:
+ ----- Method: CMWin32Freetype2>>setVariables (in category 'generating actions') -----
+ setVariables
+ super setVariables.
+
+ "add include path"
+ gen
+ set: #freetype2_includeDir toString: '${installPrefix}/include';
+ set: #libraryFileName to: self libraryFileName;
+ set: #freetype2_location toString: '${externalModulesDir}/${libraryFileName}';
+ set: #ft2config toString: '${libSourcesDir}/builds/unix/config.status';
+ set: #ft2libInstalled toString: '${installPrefix}/lib/${libraryFileName}';
+ set: #ft2binInstalled toString: '${installPrefix}/bin/libfreetype-6.dll'.
+ !
Item was changed:
----- Method: CogFamilyWindowsConfig>>configureFT2Plugin: (in category 'plugin extra rules') -----
+ configureFT2Plugin: maker
- configureFT2Plugin: maker
- "extra rules for FT2Plugin"
-
-
"extra rules for Freetype plugin.
a custom rule to build freetype library"
+ | lib |
+
+ " maker isExternal ifFalse: [
+ self error: 'building internal FT2Plugin is not supported yet'
+ ].
+ "
+ "add freetype library into loop"
+ lib := self addThirdpartyLibrary: 'freetype2'.
+ "link plugin with freetype lib"
+ maker addExternalLibrary: lib targetForLinking.
+ maker includeDirectories: lib includeDir.
- maker set: #freetypeLibDir toString: '${buildDir}/FT2Plugin'.
- maker set: #freetypeLib toString: '${freetypeLibDir}/libfreetype.dll.a'.
-
- maker cmd: 'add_custom_command' params: 'OUTPUT ${freetypeLib}
- COMMAND "${pluginPlatform}/makeFreetype.dynamic.win32" "${freetypeLibDir}" "${outputDir}"
- COMMENT "Building freetype library"
- '.
-
- maker addSource: '${freetypeLib}'.
- maker addExternalLibrary: '"${freetypeLib}"'.
-
- "the freetype sources are located in {build}/FT2Plugin/freetype2/include "
- maker includeDirectories: '${freetypeLibDir}/freetype2/include'
-
!
Item was added:
+ ----- Method: CogFamilyWindowsConfig>>externalModulesDir (in category 'as yet unclassified') -----
+ externalModulesDir
+ "answer the location in VM bundle, where plugins and rest of dynamic libs will be copied,
+ "
+ ^ '${outputDir}'!
Item was changed:
----- Method: CogFamilyWindowsConfig>>setupDirectories: (in category 'as yet unclassified') -----
setupDirectories: gen
"we have to override that, because we need to convert windoze paths to msys ones"
-
| dirsInclude |
-
" write the directories in separate include file"
dirsInclude := gen captureOutputDuring: [
gen
set: #topDir toString: (self msysPathFor: self topDir fullName);
set: #buildDir toString: (self buildDir ifNil: ['${topDir}/build'] ifNotNil:[ self msysPathFor: self buildDir fullName ]);
set: #thirdpartyDir toString: '${buildDir}/thirdparty';
set: #platformsDir toString: (self msysPathFor: self platformsDir);
set: #srcDir toString: (self msysPathFor: self srcDir);
set: #srcPluginsDir toString: (pluginsDir ifNil: [ '${srcDir}/plugins' ]);
set: #srcVMDir toString: '${srcDir}/vm';
set: #platformName toString: self platformName;
set: #targetPlatform to: '${platformsDir}/${platformName}';
set: #crossDir toString: '${platformsDir}/Cross';
set: #platformVMDir toString: '${targetPlatform}/vm';
set: #outputDir toString: (self msysPathFor: self outputDir).
].
self write: dirsInclude toFile: 'directories.cmake'.
gen include: 'directories.cmake'.
+
+ gen set: #externalModulesDir toString: self externalModulesDir.
+ !
- !
More information about the Vm-dev
mailing list