summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-18 16:05:14 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-18 16:05:14 +0300
commitb7da52ec5711e999963df218d4fad69a8025daeb (patch)
treef196680c65574195b528d9382cf9c4c2755bd6f5 /CMakeLists.txt
parentebee2c2cd7741c5174cbea7190bad94556bd7362 (diff)
Added build options for X11
Build option to use software rendering if running under X11, and another option to set the position of a window only after the window has been shown. The latter is a workaround for an SDL bug regarding window borders affecting the initial position.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f6c6064..d23ff2ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,8 +27,10 @@ project (Lagrange
27set (COPYRIGHT_YEAR 2020) 27set (COPYRIGHT_YEAR 2020)
28 28
29# Build configuration. 29# Build configuration.
30option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF)
30option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) 31option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON)
31option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF) 32option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF)
33option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF)
32 34
33include (BuildType.cmake) 35include (BuildType.cmake)
34include (Embed.cmake) 36include (Embed.cmake)
@@ -170,9 +172,15 @@ target_compile_options (app PUBLIC
170 ${SDL2_CFLAGS} 172 ${SDL2_CFLAGS}
171) 173)
172target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") 174target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}")
175if (ENABLE_X11_SWRENDER)
176 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_X11_SWRENDER=1)
177endif ()
173if (ENABLE_KERNING) 178if (ENABLE_KERNING)
174 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) 179 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1)
175endif () 180endif ()
181if (ENABLE_WINDOWPOS_FIX)
182 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1)
183endif ()
176target_link_libraries (app PUBLIC the_Foundation::the_Foundation) 184target_link_libraries (app PUBLIC the_Foundation::the_Foundation)
177target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) 185target_link_libraries (app PUBLIC ${SDL2_LDFLAGS})
178if (APPLE) 186if (APPLE)