mactype/doc/HOWTOBUILD.md

73 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

# How to build
2016-08-26 13:52:44 +08:00
1. **Compiler / IDE**
Visual Studio 2019 with v142 toolkit has been tested and is working. Toolkits down to v120 should be able to compile the code, but be aware that the `_xp` ones might refuse to use the Windows 10 SDK.
2016-08-26 13:52:44 +08:00
2. **Dependencies**
2016-08-26 13:52:44 +08:00
Mactype depends on
- [Freetype](https://www.freetype.org/download.html)
2022-08-10 15:39:28 +08:00
- For the lastest version of Mactype, a customized version of FreeType is required, which can be obtained from https://github.com/snowie2000/freetype
2023-08-21 15:59:22 +08:00
- [EasyHook](http://easyhook.github.io/) / [Detours](https://github.com/microsoft/Detours)
- [IniParser (fork)](https://github.com/snowie2000/IniParser)
- [wow64ext (fork)](https://github.com/snowie2000/rewolf-wow64ext)
- Windows SDK (10.0.14393.0 or later)
3. **Building dependencies**
- FreeType
Apply `glyph_to_bitmapex.diff` before building.
2016-08-26 13:52:44 +08:00
Always build multi-thread release.
2016-08-26 15:49:41 +08:00
Remember to enable options you want in ftoptions.h
Compile freetype as freetype.lib for x86 and freetype64.lib for x64
Static library is preferred, you are free to build freetype as independent dlls with better interchangeability but you will lose some compatibility in return, for some programs are delivered with their own copies of freetype which will conflict with your file.
Set `FREETYPE_PATH` environment variable to root of freetype source.
- iniParser
Build as iniparser.lib and iniparser64.lib. Set `INI_PARSER_PATH` environment variable to root of IniParser project.
- wow64ext
Build as wow64ext.lib. x64 library is not required. Shared library also works if you prefer that.
- EasyHook
2016-08-26 13:52:44 +08:00
Only EasyHookDll project is required.
2016-08-26 15:49:41 +08:00
Build it as easyhook32.lib and easyhook64.lib, or get the binary distributions.
Dll filename is not important but you'd better give it a special name to avoid dll confliction as stated above. Do not forget to modify filename in `hook.cpp` of MacType.
2023-08-21 15:59:22 +08:00
- Detours
Since Microsoft Detours is now free and opensource, it is back to be supported and recommended.
Follow the official guide to build detours.lib and detours64.lib and put them in the root of MacType.
Detours lib are static libraries, so name confiction is not a thing.
- Windows SDK
2016-08-26 13:52:44 +08:00
Actually it's not something you need to build, but the installation is tricky.
2016-08-26 15:49:41 +08:00
One word to rule them all: download **ALL COMPONENTS** in the installation list! Unless you want to waste several hours looking for these mysterious dependencies it pops to you. Don't worry, you will have a second chance to choose which component you want to install after download.
4. **Build**
Last but easiest step: Put all `.lib` files you built earlier into a `lib` folder in the root of MacType, click build and enjoy.
2016-08-26 13:52:44 +08:00
## FAQ
2016-08-26 13:52:44 +08:00
Q: Where are the sources of loader and tuner in the repo?
2016-08-26 13:52:44 +08:00
A: I'm sorry, but they are still closed-source right now. Since you have the mactype source and will surely have a good understanding of how mactype works, I believe it's not a big challenge to write a loader for it.
If you wrote a great loader or something else wonderful, please post an issue or a pull request. Hope we can make MacType better!