The `install(TARGETS ...)` command in `cmake/ftxui_install.cmake` was missing required destination specifications that became mandatory in CMake 3.12+. This caused build failures when users tried to install FTXUI with the minimum supported CMake version.
The issue occurred because the install command:
```cmake
install(
TARGETS screen dom component
EXPORT ftxui-targets
)
```
Was missing explicit destination specifications for different artifact types. CMake 3.12+ requires these destinations to be explicitly declared.
This PR adds the required destination specifications:
```cmake
install(
TARGETS screen dom component
EXPORT ftxui-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
```
The fix ensures that:
- Static libraries (`.a` files) are installed to the archive destination
- Shared libraries are installed to the library destination
- Executables are installed to the runtime destination
All destinations use CMake's standard directory variables for proper cross-platform compatibility. The change is backward compatible and maintains the same installation behavior while satisfying CMake 3.12+ requirements.
Fixes#1118.
The cursor_ variable was being default initialized, which causes
undefined behaviour when accessing properties in
ScreenInteractive::Draw. This caused a crash when running with UBSAN.
```
ftxui/src/ftxui/component/screen_interactive.cpp:852:17: runtime error:
load of value 4195502944, which is not a valid value for type 'Shape'
```
This change causes the shape variable to be explicitly initialized,
similar to the x and y members.
Co-authored-by: Benjamin Gwin <bgwin@google.com>
Warn users they have defined the min/max macros which is not
compatible with other code from the standard library or FTXUI.
Co-authored-by: Sylko Olzscher <sylko.olzscher@solostec.ch>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
Stop using Sender/Receiver in TerminalInputParser.
This will help removing usage of thread.
At some point, my goal is to have an initialization step when installing
the ScreenInteractive so that we can provide the terminal ID
synchronously without losing some events. This will help with:
https://github.com/ArthurSonzogni/FTXUI/pull/1069
* Bazel: general improvements.
Improve the Bazel build. Attempt to fix previous errors recorded while
trying to publish ftxui in the Bazel Central Registry:
- https://github.com/bazelbuild/bazel-central-registry/pull/4485
- https://buildkite.com/bazel/bcr-presubmit/builds/13601#01968b61-f5b2-4d16-94d0-c87a03a1a23b
Test against "recent" platforms
-------------------------------
Previously, I got the error:
```
gcc: error: unrecognized command line option '-std-c++20'; did you mean '-std-c++2a'?
```
This was due to using old distribution like ubuntu 2004. Test against
newer platforms only to avoid GCC version<-9.x.y
Downgrade gtest version.
------------------------
I suspect this caused the Bazel Central Registry error:
```
file:///workdir/modules/googletest/1.15.2/MODULE.bazel:68:20: name 'use_repo_rule' is not defined
```
Specifying using bazelmod fixes the issue. Thanks @robinlinden
Tag gtest as dev_dependency
---------------------------
Presumably, this should avoid dependants to fetch it?
Enable --features-layering_check
--------------------------------
Aka clang `-Wprivate-header`. Fix the encountered errors.
Use clang in the CI
-------------------
The CI was defining clang/gcc in the matrix, but was not using it. Fix
the bug.