diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-23 22:40:31 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-23 22:40:31 +0300 |
commit | d797bdbc82e3770a3a0c0bbbf50a0174436fa798 (patch) | |
tree | b26793474322274ca891ad1410cad874ccc0c3cc /CMakeLists.txt | |
parent | 91167bd9d49ac52587da382351a009e2465c3bdd (diff) |
Build option to disable kerning; other optimizations
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5465ae58..03d253ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -7,6 +7,10 @@ project (Lagrange | |||
7 | ) | 7 | ) |
8 | set (COPYRIGHT_YEAR 2020) | 8 | set (COPYRIGHT_YEAR 2020) |
9 | 9 | ||
10 | # Build configuration. | ||
11 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) | ||
12 | option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF) | ||
13 | |||
10 | include (Embed.cmake) | 14 | include (Embed.cmake) |
11 | find_package (the_Foundation REQUIRED) | 15 | find_package (the_Foundation REQUIRED) |
12 | find_package (PkgConfig REQUIRED) | 16 | find_package (PkgConfig REQUIRED) |
@@ -15,7 +19,6 @@ pkg_check_modules (SDL2 REQUIRED sdl2) | |||
15 | # Embedded resources are written to a generated source file. | 19 | # Embedded resources are written to a generated source file. |
16 | message (STATUS "Preparing embedded resources...") | 20 | message (STATUS "Preparing embedded resources...") |
17 | # Fonts are too large to comfortably embed as a C source. | 21 | # Fonts are too large to comfortably embed as a C source. |
18 | set (EMBED_IN_EXECUTABLE OFF CACHE BOOL "Embed resources inside the executable") | ||
19 | set (EMBED_RESOURCES | 22 | set (EMBED_RESOURCES |
20 | res/about/help.gmi | 23 | res/about/help.gmi |
21 | res/about/lagrange.gmi | 24 | res/about/lagrange.gmi |
@@ -113,9 +116,13 @@ target_include_directories (app PUBLIC | |||
113 | ) | 116 | ) |
114 | target_compile_options (app PUBLIC | 117 | target_compile_options (app PUBLIC |
115 | -Werror=implicit-function-declaration | 118 | -Werror=implicit-function-declaration |
119 | -Werror=incompatible-pointer-types | ||
116 | ${SDL2_CFLAGS} | 120 | ${SDL2_CFLAGS} |
117 | ) | 121 | ) |
118 | target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") | 122 | target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") |
123 | if (ENABLE_KERNING) | ||
124 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) | ||
125 | endif () | ||
119 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) | 126 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) |
120 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) | 127 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) |
121 | if (APPLE) | 128 | if (APPLE) |
@@ -145,7 +152,7 @@ endif () | |||
145 | # Deployment. | 152 | # Deployment. |
146 | if (MSYS) | 153 | if (MSYS) |
147 | install (TARGETS app DESTINATION .) | 154 | install (TARGETS app DESTINATION .) |
148 | if (NOT EMBED_IN_EXECUTABLE) | 155 | if (NOT ENABLE_RESOURCE_EMBED) |
149 | install (FILES ${EMB_BIN} DESTINATION .) | 156 | install (FILES ${EMB_BIN} DESTINATION .) |
150 | endif () | 157 | endif () |
151 | install (PROGRAMS | 158 | install (PROGRAMS |
@@ -172,7 +179,7 @@ Icon=fi.skyjake.lagrange") | |||
172 | DESTINATION share/icons/hicolor/256x256/apps | 179 | DESTINATION share/icons/hicolor/256x256/apps |
173 | RENAME fi.skyjake.lagrange.png | 180 | RENAME fi.skyjake.lagrange.png |
174 | ) | 181 | ) |
175 | if (NOT EMBED_IN_EXECUTABLE) | 182 | if (NOT ENABLE_RESOURCE_EMBED) |
176 | install (FILES ${EMB_BIN} DESTINATION share/lagrange) | 183 | install (FILES ${EMB_BIN} DESTINATION share/lagrange) |
177 | endif () | 184 | endif () |
178 | endif () | 185 | endif () |