summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-23 22:40:31 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-23 22:40:31 +0300
commitd797bdbc82e3770a3a0c0bbbf50a0174436fa798 (patch)
treeb26793474322274ca891ad1410cad874ccc0c3cc /CMakeLists.txt
parent91167bd9d49ac52587da382351a009e2465c3bdd (diff)
Build option to disable kerning; other optimizations
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
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)
8set (COPYRIGHT_YEAR 2020) 8set (COPYRIGHT_YEAR 2020)
9 9
10# Build configuration.
11option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON)
12option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF)
13
10include (Embed.cmake) 14include (Embed.cmake)
11find_package (the_Foundation REQUIRED) 15find_package (the_Foundation REQUIRED)
12find_package (PkgConfig REQUIRED) 16find_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.
16message (STATUS "Preparing embedded resources...") 20message (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.
18set (EMBED_IN_EXECUTABLE OFF CACHE BOOL "Embed resources inside the executable")
19set (EMBED_RESOURCES 22set (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)
114target_compile_options (app PUBLIC 117target_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)
118target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") 122target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}")
123if (ENABLE_KERNING)
124 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1)
125endif ()
119target_link_libraries (app PUBLIC the_Foundation::the_Foundation) 126target_link_libraries (app PUBLIC the_Foundation::the_Foundation)
120target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) 127target_link_libraries (app PUBLIC ${SDL2_LDFLAGS})
121if (APPLE) 128if (APPLE)
@@ -145,7 +152,7 @@ endif ()
145# Deployment. 152# Deployment.
146if (MSYS) 153if (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 ()
178endif () 185endif ()