fix: example app build for Linux (Issue #1667) #1668
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request addresses the issue where the example app in the fl_chart repository fails to build on Linux due to invalid target names in the CMake configuration.
Issue Description
The build process for the Linux platform fails with the following errors:
Steps to Reproduce
Root Cause
The target name "FL Chart App" used in the CMake configuration is invalid for certain CMake features and can lead to undefined behavior. CMake target names should not contain spaces or special characters and should adhere to simple alphanumeric naming conventions.
Solution
The solution involves renaming the target in the CMakeLists.txt file to a valid name. The target name was changed from "FL Chart App" to "fLChartApp".
Changes Made
In CMakeLists.txt:
Testing
After making this change, the example app successfully builds and runs on Linux.
The new target name adheres to CMake naming conventions and resolves the build issues.
Run flutter clean to clear old build and flutter run again.