mirror of https://github.com/Chlumsky/msdfgen.git
More compatibility fixes
This commit is contained in:
parent
2ded35238e
commit
cc7b4fe58e
|
|
@ -6,22 +6,22 @@ import re
|
||||||
rootDir = os.path.join(os.path.dirname(__file__), '..')
|
rootDir = os.path.join(os.path.dirname(__file__), '..')
|
||||||
|
|
||||||
sourceList = [
|
sourceList = [
|
||||||
|
'core/base.h',
|
||||||
'core/arithmetics.hpp',
|
'core/arithmetics.hpp',
|
||||||
'core/equation-solver.h',
|
'core/equation-solver.h',
|
||||||
'core/equation-solver.cpp',
|
'core/equation-solver.cpp',
|
||||||
'core/Vector2.h',
|
'core/Vector2.hpp',
|
||||||
'core/Vector2.cpp',
|
|
||||||
'core/pixel-conversion.hpp',
|
'core/pixel-conversion.hpp',
|
||||||
'core/BitmapRef.hpp',
|
'core/BitmapRef.hpp',
|
||||||
'core/Bitmap.h',
|
'core/Bitmap.h',
|
||||||
'core/Bitmap.hpp',
|
'core/Bitmap.hpp',
|
||||||
'core/Projection.h',
|
'core/Projection.h',
|
||||||
'core/Projection.cpp',
|
'core/Projection.cpp',
|
||||||
'core/SignedDistance.h',
|
'core/SignedDistance.hpp',
|
||||||
'core/SignedDistance.cpp',
|
|
||||||
'core/Scanline.h',
|
'core/Scanline.h',
|
||||||
'core/Scanline.cpp',
|
'core/Scanline.cpp',
|
||||||
'core/EdgeColor.h',
|
'core/EdgeColor.h',
|
||||||
|
'core/bezier-solver.hpp',
|
||||||
'core/edge-segments.h',
|
'core/edge-segments.h',
|
||||||
'core/edge-segments.cpp',
|
'core/edge-segments.cpp',
|
||||||
'core/EdgeHolder.h',
|
'core/EdgeHolder.h',
|
||||||
|
|
@ -39,6 +39,8 @@ sourceList = [
|
||||||
'core/contour-combiners.cpp',
|
'core/contour-combiners.cpp',
|
||||||
'core/ShapeDistanceFinder.h',
|
'core/ShapeDistanceFinder.h',
|
||||||
'core/ShapeDistanceFinder.hpp',
|
'core/ShapeDistanceFinder.hpp',
|
||||||
|
'core/approximate-sdf.h',
|
||||||
|
'core/approximate-sdf.cpp',
|
||||||
'core/generator-config.h',
|
'core/generator-config.h',
|
||||||
'core/msdf-error-correction.h',
|
'core/msdf-error-correction.h',
|
||||||
'core/msdf-error-correction.cpp',
|
'core/msdf-error-correction.cpp',
|
||||||
|
|
@ -57,6 +59,7 @@ header = """
|
||||||
|
|
||||||
#define MSDFGEN_USE_CPP11
|
#define MSDFGEN_USE_CPP11
|
||||||
#define MSDFGEN_USE_FREETYPE
|
#define MSDFGEN_USE_FREETYPE
|
||||||
|
#define MSDFGEN_DISABLE_VARIABLE_FONTS
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
@ -68,7 +71,6 @@ header = """
|
||||||
source = """
|
source = """
|
||||||
#include "msdfgen.h"
|
#include "msdfgen.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
#ifdef MSDFGEN_USE_FREETYPE
|
#ifdef MSDFGEN_USE_FREETYPE
|
||||||
|
|
@ -81,7 +83,11 @@ source = """
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable : 4456 4458)
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4456 4457 4458)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
|
|
@ -89,6 +95,14 @@ source = """
|
||||||
#endif
|
#endif
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
sourceAppendix = """
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
"""
|
||||||
|
|
||||||
with open(os.path.join(rootDir, 'LICENSE.txt'), 'r') as file:
|
with open(os.path.join(rootDir, 'LICENSE.txt'), 'r') as file:
|
||||||
license = file.read()
|
license = file.read()
|
||||||
license = '\n'.join([' * '+line for line in license.strip().split('\n')])
|
license = '\n'.join([' * '+line for line in license.strip().split('\n')])
|
||||||
|
|
@ -134,7 +148,7 @@ source = """
|
||||||
"""+license+"""
|
"""+license+"""
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
"""+source
|
"""+source+sourceAppendix
|
||||||
|
|
||||||
with open(os.path.join(os.path.dirname(__file__), 'msdfgen.h'), 'w') as file:
|
with open(os.path.join(os.path.dirname(__file__), 'msdfgen.h'), 'w') as file:
|
||||||
file.write(header)
|
file.write(header)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue