diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-18 16:05:14 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-18 16:05:14 +0300 |
commit | b7da52ec5711e999963df218d4fad69a8025daeb (patch) | |
tree | f196680c65574195b528d9382cf9c4c2755bd6f5 /CMakeLists.txt | |
parent | ebee2c2cd7741c5174cbea7190bad94556bd7362 (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.txt | 8 |
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 | |||
27 | set (COPYRIGHT_YEAR 2020) | 27 | set (COPYRIGHT_YEAR 2020) |
28 | 28 | ||
29 | # Build configuration. | 29 | # Build configuration. |
30 | option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF) | ||
30 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) | 31 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) |
31 | option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF) | 32 | option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF) |
33 | option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) | ||
32 | 34 | ||
33 | include (BuildType.cmake) | 35 | include (BuildType.cmake) |
34 | include (Embed.cmake) | 36 | include (Embed.cmake) |
@@ -170,9 +172,15 @@ target_compile_options (app PUBLIC | |||
170 | ${SDL2_CFLAGS} | 172 | ${SDL2_CFLAGS} |
171 | ) | 173 | ) |
172 | target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") | 174 | target_compile_definitions (app PUBLIC LAGRANGE_APP_VERSION="${PROJECT_VERSION}") |
175 | if (ENABLE_X11_SWRENDER) | ||
176 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_X11_SWRENDER=1) | ||
177 | endif () | ||
173 | if (ENABLE_KERNING) | 178 | if (ENABLE_KERNING) |
174 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) | 179 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1) |
175 | endif () | 180 | endif () |
181 | if (ENABLE_WINDOWPOS_FIX) | ||
182 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1) | ||
183 | endif () | ||
176 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) | 184 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) |
177 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) | 185 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) |
178 | if (APPLE) | 186 | if (APPLE) |