Reorganize options targeting mcu
PR Description
Resolves #1256
PR Type
- [ ] Bug fix (a change that fixes an issue)
- [x] New feature (a change that adds new functionality)
- [ ] Breaking change (a change that affects other repos or cause CIs to fail)
PR Checklist
- [x] I have conducted a self-review of my own code changes
- [ ] I have commented new code, particulary complex or unclear areas
- [ ] I have checked that I did not intoduced new warnings or errors (CI output)
- [ ] I have checked that components that use libiio did not get broken
- [ ] I have updated the documentation accordingly (GitHub Pages, READMEs, etc)
I think this PR has reach its final state in terms of changes which include:
- cmake will turn ON or OFF the relevant options when configuring for Tinyiiod. It's enough to run:
cmake -DWITH_LIBTINYIIOD=ON .. - Once you turn WITH_LIBTINYIIOD to ON and want to turn it OFF again, you need to empty your build dir
- Updates to the check_README_BUILD.sh due to the changes regarding options in CMakeFiles.txt
- Fixes for when building with Tinyiiod configuration
- Documentation updates
While working at this I came across the presets functionality that modern CMake has. I gave it a try and here you can see how it looks like: https://github.com/analogdevicesinc/libiio/compare/main..tinyiiod-preset-options This can be an alternative but:
- we would then need to keep track of the options both in the CMakeFile.txt and CMakePresets.json
- users could still overwrite the options values in the presets file. In the current state of the PR this won't happen.
cmake presets are only available in cmake > 3.19 (which would eliminate these older distributions).
| Operating System | Cmake Version |
|---|---|
| LinuxBuilds fedora28 | cmake version: 3.14.4 |
| LinuxBuilds ubuntu_20_04 | cmake version: 3.16.3 |
| ARMBuilds ubuntu-ppc64le | cmake version: 3.16.3 |
| ARMBuilds ubuntu-x390x | cmake version: 3.16.3 |
| ARMBuilds ubuntu-arm64v8 | cmake version: 3.16.3 |
| LinuxBuilds debian_bullseye | cmake version: 3.18.4 |
and leave us with only:
| Operating System | Cmake Version |
|---|---|
| LinuxBuilds opensuse_15_4 | cmake version: 3.20.4 |
| LinuxBuilds fedora34 | cmake version: 3.20.5 |
| LinuxBuilds ubuntu_22_04 | cmake version: 3.22.1 |
| ARMBuilds ubuntu-arm32v7 | cmake version: 3.23.2 |
| ARMBuilds debian_bookworm | cmake version: 3.23.2 |
| LinuxBuilds centos_7 | cmake version: 3.23.2 |
| LinuxBuilds debian_bookworm | cmake version: 3.25.1 |
| macOSBuilds macOS_13_arm64 | cmake version: 3.27.3 |
| WindowsBuilds VS2022 | cmake version: 3.31.6 |
| WindowsBuilds VS2019 | cmake version: 3.31.6 |
| macOSBuilds macOS_13_x64 | cmake version: 3.31.6 |
| MinGWBuilds MinGW_W64 | cmake version: 4.0.2 |
I don't know if that is what you want to do or not?
I don't know if that is what you want to do or not?
I wouldn't want to lose those older distributions. Additionally, the current implementation works properly without any major drawbacks. Therefore, I would go ahead and merge these changes. In the long term, I can see a transition to cmake presets.