Added solution for Visual Studio 2013 (including Windows Store & Windows Phone) and build scripts for Android and iOS

This commit is contained in:
Virgile Bello 2014-10-16 15:57:30 +09:00
Родитель ed372b712f
Коммит 90cc3051e8
8 изменённых файлов: 2616 добавлений и 0 удалений

40
buildAndroid Executable file
Просмотреть файл

@ -0,0 +1,40 @@
#!/bin/bash
# Set local variables
ANDROID_TARGET_PLATFORM=android-9
NDK_HOST_NAME=arm-linux-androideabi
NDK_STANDALONE_DIR=~/ndk-standalone-9
# Create the standalone compiler
rm -r $NDK_STANDALONE_DIR
~/android-ndk-r9d/build/tools/make-standalone-toolchain.sh --platform=$ANDROID_TARGET_PLATFORM --install-dir=$NDK_STANDALONE_DIR --toolchain=arm-linux-androideabi-clang3.4
# Add the compiler path to the path
export PATH=$NDK_STANDALONE_DIR/bin:$PATH
function BuildAndInstallAndroid
{
ARCHI=$1
if [ "$ARCHI" = "armeabi-v7a" ]; then
ARCHI_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
ARCHI_LDFLAGS="-march=armv7-a -Wl,--fix-cortex-a8"
fi
# Set compilation flags
unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAG
export CC=$NDK_HOST_NAME-clang
export LDFLAGS="$ARCHI_LDFLAGS"
export CFLAGS="$ARCHI_CFLAGS -O3 -std=c99"
# Configure the build
./configure --host=$NDK_HOST_NAME --prefix=/android-$ARCHI --without-zlib --enable-shared
# Perform the build and install it
make clean
make
make install DESTDIR=$(pwd)
}
BuildAndInstallAndroid armeabi
BuildAndInstallAndroid armeabi-v7a

47
buildiOS Executable file
Просмотреть файл

@ -0,0 +1,47 @@
#!/bin/bash
# Define script constants
OUTPUT_LIB_DIR=./ios
IPHONE_PLATFORM_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
IPHONE_SDK_DIR="$IPHONE_PLATFORM_DIR/SDKs/iPhoneOS7.1.sdk"
IPHONE_DEPLOY_TARGET=3.2
function BuildAndInstall
{
#define function variables
ARCHI=$1
#clear and redefine build flags
unset CFLAGS CC AR LDFLAGS LD CPP CXX AR AS NM CXXCPP RANLIB CPPFLAGS CXXFLAGS
export CFLAGS="-arch $ARCHI"
if [[ $ARCHI == arm* ]]; then
PLATFORM_SPECIFIC="--without-zlib --without-png --without-bzip2 --prefix=/usr/local/iPhone --host=arm-apple-darwin${ARCHI: -1} --enable-static=yes --enable-shared=no"
export CC="$(xcrun -find -sdk iphoneos clang)"
export CFLAGS="$CFLAGS -x c -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DFT2_BUILD_LIBRARY=1 -DDARWIN_NO_CARBON -isysroot $IPHONE_SDK_DIR -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -miphoneos-version-min=$IPHONE_DEPLOY_TARGET -Wextra -Wall -MMD"
export AR="$IPHONE_PLATFORM_DIR/usr/bin/ar"
export LDFLAGS="-arch $ARCHI -isysroot $IPHONE_SDK_DIR/ -miphoneos-version-min=$IPHONE_DEPLOY_TARGET"
fi
# configure the build
./configure $PLATFORM_SPECIFIC
# Perform the build and install it
make clean
make
cp objs/.libs/libfreetype.a $OUTPUT_LIB_DIR/libfreetype-$ARCHI.a
}
# emulator
BuildAndInstall i386
BuildAndInstall x86_64
# iphone
#BuildAndInstall armv6 #current version of xCode does not support armv6 anymore. Need to re-install old version of Xcode if we want to compile it for armv6
BuildAndInstall armv7
# Combine together the different versions of library into a single ".a" file
cd $OUTPUT_LIB_DIR
lipo -create -output libfreetype.a libfreetype-*
# Note: in case of problem here are the name of two tools that can be very usefull to analyze the generated assemblies
# 1. nm -> display symbol table
# 2. otool -> O-Mach analyzer / disassembler

Просмотреть файл

@ -0,0 +1,29 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SiliconStudioPlatform Condition="'$(SiliconStudioPlatform)' == ''">Windows</SiliconStudioPlatform>
<!-- Determine CPU (note: remap Win32 to x86) -->
<SiliconStudioCPU>$(Platform)</SiliconStudioCPU>
<SiliconStudioCPU Condition="'$(SiliconStudioCPU)' == 'Win32'">x86</SiliconStudioCPU>
<OutDir>bin\$(SiliconStudioPlatform)\$(SiliconStudioCPU)\</OutDir>
<IntDir>obj\$(SiliconStudioPlatform)\$(SiliconStudioCPU)\</IntDir>
<GenerateProjectSpecificOutputFolder>false</GenerateProjectSpecificOutputFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(SiliconStudioPlatform)' == 'WindowsStore' Or '$(SiliconStudioPlatform)' == 'WindowsPhone'">
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType Condition="'$(SiliconStudioPlatform)' == 'WindowsStore'">Windows Store</ApplicationType>
<ApplicationType Condition="'$(SiliconStudioPlatform)' == 'WindowsPhone'">Windows Phone</ApplicationType>
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
<ConvergedProjectType>CodeSharingDll</ConvergedProjectType>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'">
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0' And '$(SiliconStudioPlatform)' == 'WindowsStore'">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0' And '$(SiliconStudioPlatform)' == 'WindowsPhone'">
<PlatformToolset>v120_wp81</PlatformToolset>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,70 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug Multithreaded|ARM = Debug Multithreaded|ARM
Debug Multithreaded|Win32 = Debug Multithreaded|Win32
Debug Multithreaded|x64 = Debug Multithreaded|x64
Debug Singlethreaded|ARM = Debug Singlethreaded|ARM
Debug Singlethreaded|Win32 = Debug Singlethreaded|Win32
Debug Singlethreaded|x64 = Debug Singlethreaded|x64
Debug|ARM = Debug|ARM
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release Multithreaded|ARM = Release Multithreaded|ARM
Release Multithreaded|Win32 = Release Multithreaded|Win32
Release Multithreaded|x64 = Release Multithreaded|x64
Release Singlethreaded|ARM = Release Singlethreaded|ARM
Release Singlethreaded|Win32 = Release Singlethreaded|Win32
Release Singlethreaded|x64 = Release Singlethreaded|x64
Release|ARM = Release|ARM
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|ARM.ActiveCfg = Debug Multithreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|ARM.Build.0 = Debug Multithreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.ActiveCfg = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.Build.0 = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|ARM.ActiveCfg = Debug Singlethreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|ARM.Build.0 = Debug Singlethreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.ActiveCfg = Debug Singlethreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.Build.0 = Debug Singlethreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.ActiveCfg = Debug Singlethreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.Build.0 = Debug Singlethreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|ARM.ActiveCfg = Debug|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|ARM.Build.0 = Debug|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|ARM.ActiveCfg = Release Multithreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|ARM.Build.0 = Release Multithreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.ActiveCfg = Release Multithreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.Build.0 = Release Multithreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|x64.ActiveCfg = Release Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|x64.Build.0 = Release Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|ARM.ActiveCfg = Release Singlethreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|ARM.Build.0 = Release Singlethreaded|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.ActiveCfg = Release Singlethreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.Build.0 = Release Singlethreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.ActiveCfg = Release Singlethreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.Build.0 = Release Singlethreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|ARM.ActiveCfg = Release|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|ARM.Build.0 = Release|ARM
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{b4c15893-ec11-491d-9507-0ac184f9cc78}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Source Files\FT_MODULES">
<UniqueIdentifier>{4d3e4eff-3fbc-4b20-b413-2743b23b7109}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{e6cf6a0f-0404-4024-8bf8-ff5b29f35657}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\autofit\autofit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\bdf\bdf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\cff\cff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftbase.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftbitmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\cache\ftcache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ftdebug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftfstype.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftgasp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftglyph.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\gzip\ftgzip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\lzw\ftlzw.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftstroke.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftsystem.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\smooth\smooth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftbbox.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftmm.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftpfr.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftsynth.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\fttype1.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftwinfnt.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftxf86.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftlcdfil.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftgxval.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftotval.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\base\ftpatent.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\pcf\pcf.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\pfr\pfr.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\psaux\psaux.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\pshinter\pshinter.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\psnames\psmodule.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\raster\raster.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\sfnt\sfnt.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\truetype\truetype.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\type1\type1.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\cid\type1cid.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\type42\type42.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\winfonts\winfnt.c">
<Filter>Source Files\FT_MODULES</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\ft2build.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\config\ftconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\config\ftheader.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\config\ftmodule.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\config\ftoption.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\config\ftstdlib.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,42 @@
<html>
<header>
<title>
FreeType&nbsp;2 Project Files for VS.NET&nbsp;2012 or newer
</title>
<body>
<h1>
FreeType&nbsp;2 Project Files for VS.NET&nbsp;2012 or newer
</h1>
<p>This directory contains a project file for Visual C++ (VS.NET&nbsp;2010
or newer), named <tt>freetype.vcxproj</tt>, and Visual Studio, called
<tt>freetype.sln</tt>. It compiles the following libraries from the
FreeType 2.5.3 sources:</p>
<ul>
<pre>
freetype253.lib - release build
freetype253_D.lib - debug build
freetype253ST.lib - release build; single threaded
freetype253ST_D.lib - debug build; single threaded
freetype253MT.lib - release build; multi-threaded
freetype253MT_D.lib - debug build; multi-threaded</pre>
</ul>
<p>Both Win32 and x64 builds are supported.</p>
<p>Be sure to extract the files with the Windows (CR+LF) line endings. ZIP
archives are already stored this way, so no further action is required. If
you use some <tt>.tar.*z</tt> archives, be sure to configure your extracting
tool to convert the line endings. For example, with <a
href="http://www.winzip.com">WinZip</a>, you should activate the <it>TAR
file smart CR/LF Conversion</it> option. Alternatively, you may consider
using the <tt>unix2dos</tt> or <tt>u2d</tt> utilities that are floating
around, which specifically deal with this particular problem.
<p>Build directories are placed in the top-level <tt>objs</tt>
directory.</p>
</body>
</html>

Просмотреть файл

@ -282,6 +282,10 @@ FT_BEGIN_HEADER
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
#ifdef WIN32
#define FT_EXPORT(x) __declspec(dllexport) x
#define FT_BASE(x) __declspec(dllexport) x
#endif
/*************************************************************************/
/* */