Skip to content

Modernize, cleanup, simplify the build system (cmake)#173

Open
mkoloberdin wants to merge 5 commits into
samstyle:masterfrom
mkoloberdin:cmake-improve
Open

Modernize, cleanup, simplify the build system (cmake)#173
mkoloberdin wants to merge 5 commits into
samstyle:masterfrom
mkoloberdin:cmake-improve

Conversation

@mkoloberdin
Copy link
Copy Markdown
Contributor

  • CMake: 3.22 (2021) is reasonable and compatible for most users in 2026.
  • Qt4: not maintained since 2023 - https://zx-pk.ru/threads/9479-xpeccy.html?p=1184146&viewfull=1#post1184146
  • Qt5: >= 5.15 (2020, LTS)
  • SDL1: not maintained; the codebase already assumes SDL2 for joystick events, audio device API.
  • C++17: mandatory for QT6; Qt 5.15 - C++17 support "fully embraced"; supported by both gcc and clang for years.
  • Add CMAKE_EXPORT_COMPILE_COMMANDS ON - gives clangd (and any LSP client) perfect include paths.
  • Declared options (USEOPENGL, USEQTNETWORK) and cached var (QTVERSION) - makes them discoverable via cmake -LH and cmake-gui.
    • USEOPENGL - default: ON
    • USEQTNETWORK - default: OFF
    • QTVERSION - autodetected if not specified, preferred: 6.

@mkoloberdin mkoloberdin force-pushed the cmake-improve branch 2 times, most recently from fc677d9 to caa2617 Compare April 18, 2026 17:36
Set CMAKE_C_STANDARD 17 and CMAKE_CXX_STANDARD 17 globally, removing
the hardcoded -std=c++11 and -std=gnu99 flags that conflicted with
CMAKE_*_STANDARD. Delete the redundant Qt6-block-only C++17 setting.

Fix three bare `inline` functions in C files that became undefined
references under C17 inline semantics (C99 always-inlined them):
  - lr_pref_cb.c: lr_swaph → static inline (file-local)
  - video.c: vid_dot_full, vid_dot_half → plain (extern via header)

Remove dead Qt4 CMake block (EOL 2015, incompatible with C++17).
Remove dead SDL1 CMake block (EOL 2012).
Add CMAKE_EXPORT_COMPILE_COMMANDS ON for clangd/LSP support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant