mirror of
https://github.com/love2d/megasource.git
synced 2026-08-12 00:20:55 +02:00
Add freetype to main CMakeLists.txt.
This commit is contained in:
@@ -15,6 +15,7 @@ set(DEP_JPEG_VER "9")
|
||||
set(DEP_LIBOGG_VER "1.3.1")
|
||||
set(DEP_LIBVORBIS_VER "1.3.3")
|
||||
set(DEP_MPG123_VER "1.15.3")
|
||||
set(DEP_FREETYPE_VER "2.5.0.1")
|
||||
|
||||
set(SKIP_INSTALL_ALL TRUE)
|
||||
|
||||
@@ -32,6 +33,7 @@ add_subdirectory("libs/jpeg-${DEP_JPEG_VER}" ${CMAKE_BINARY_DIR}/jpeg)
|
||||
add_subdirectory("libs/libogg-${DEP_LIBOGG_VER}" ${CMAKE_BINARY_DIR}/libogg)
|
||||
add_subdirectory("libs/libvorbis-${DEP_LIBVORBIS_VER}" ${CMAKE_BINARY_DIR}/libvorbis)
|
||||
add_subdirectory("libs/mpg123-${DEP_MPG123_VER}" ${CMAKE_BINARY_DIR}/mpg123)
|
||||
add_subdirectory("libs/freetype-${DEP_FREETYPE_VER}" ${CMAKE_BINARY_DIR}/freetype)
|
||||
|
||||
add_executable(ldeptest src/test.cpp)
|
||||
target_link_libraries(ldeptest
|
||||
@@ -44,6 +46,7 @@ target_link_libraries(ldeptest
|
||||
vorbis-static
|
||||
vorbisfile-static
|
||||
mpg123
|
||||
freetype-static
|
||||
)
|
||||
|
||||
add_custom_command(TARGET ldeptest POST_BUILD
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <vorbis/codec.h>
|
||||
#include <vorbis/vorbisfile.h>
|
||||
#include "mpg123.h"
|
||||
#include <freetype/config/ftconfig.h>
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
extern "C" {
|
||||
# include "lua.h"
|
||||
@@ -104,6 +106,17 @@ int main(int argc, const char **argv)
|
||||
return "mpg123";
|
||||
};
|
||||
|
||||
vfunc freetype = [](strs &c, strs &l)
|
||||
{
|
||||
FT_Library lib;
|
||||
FT_Init_FreeType(&lib);
|
||||
FT_Int major, minor, patch;
|
||||
FT_Library_Version(lib, &major, &minor, &patch);
|
||||
c << "N/A";
|
||||
l << major << "." << minor << "." << patch;
|
||||
return "freetype";
|
||||
};
|
||||
|
||||
std::vector<vfunc> funcs;
|
||||
funcs.push_back(zlib);
|
||||
funcs.push_back(physfs);
|
||||
@@ -114,6 +127,7 @@ int main(int argc, const char **argv)
|
||||
funcs.push_back(vorbis);
|
||||
funcs.push_back(vorbisfile);
|
||||
funcs.push_back(mpg123);
|
||||
funcs.push_back(freetype);
|
||||
|
||||
for (size_t i = 0; i < funcs.size(); ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user