cmake: add BUILD_EXAMPLES option to build examples - #13491
Closed
vszakats wants to merge 6 commits into
Closed
Conversation
You can enable it with `-DBUILD_EXAMPLES=ON`. To match autotools' `make examples` feature. Closes #xxxxx
vszakats
force-pushed
the
cmake-examples
branch
from
April 27, 2024 23:58
c06ca28 to
51962ae
Compare
vszakats
force-pushed
the
cmake-examples
branch
from
April 28, 2024 00:11
81aaf9f to
abe38c4
Compare
BUILD_EXAMPLES option to build examples
vszakats
added a commit
that referenced
this pull request
Jul 8, 2024
With macOS there is a long-term struggle with deprecation warnings. In curl they occur with LDAP, SecureTransport and in docs/examples. There are three ways to fix them: - by CFLAGS `-Wno-deprecated-declarations` as a workaround. - by CFLAGS `-mmacosx-version-min` set to a version where the the feature was not deprecated. - by CMake option `-DCMAKE_OSX_DEPLOYMENT_TARGET=`. In GHA CMake jobs, all three were used, and `-mmacosx-version-min` was set in a bogus way. Delete that bogus option, and delete the lone, redundant CMake option too. In a future commit I might replace the suppression option to properly setting the target OS. Follow-up to dfdd978 #13491 Cherry-picked from #14097
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Aug 4, 2024
Follow-up to dfdd978 curl#13491 Closes #xxxxx
vszakats
added a commit
that referenced
this pull request
Sep 20, 2024
- Move `docs/examples` builds under a separate target. - Make `BUILD_EXAMPLES` default to `ON`. It means to generate the rules for `docs/examples` by default, but not build them. To build them, an explicit `make curl-examples` (or ninja, etc) command is necessary. This syncs behaviour with autotools, and also how both cmake and autotools are building tests. - GHA: update cmake jobs to use the new way of building examples. - GHA: move examples build step at the end of the job, after building and running tests. This allows to have build and test run results faster, and leave the seldom-changing examples build to the end. Building examples is the slowest build step with no practical way to make them fast. - appveyor: enable building examples in two old-MSVC jobs. - examples: fix examples to build cleanly with old MSVC versions. - GHA/non-native: move example build log under a GHA foldable section. - GHA/windows: move building examples into separate step for Linux cross jobs. Follow-up to dfdd978 #13491 Closes #14906
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
- Move `docs/examples` builds under a separate target. - Make `BUILD_EXAMPLES` default to `ON`. It means to generate the rules for `docs/examples` by default, but not build them. To build them, an explicit `make curl-examples` (or ninja, etc) command is necessary. This syncs behaviour with autotools, and also how both cmake and autotools are building tests. - GHA: update cmake jobs to use the new way of building examples. - GHA: move examples build step at the end of the job, after building and running tests. This allows to have build and test run results faster, and leave the seldom-changing examples build to the end. Building examples is the slowest build step with no practical way to make them fast. - appveyor: enable building examples in two old-MSVC jobs. - examples: fix examples to build cleanly with old MSVC versions. - GHA/non-native: move example build log under a GHA foldable section. - GHA/windows: move building examples into separate step for Linux cross jobs. Follow-up to dfdd978 curl#13491 Closes curl#14906
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
You can enable it with
-DBUILD_EXAMPLES=ON.To match autotools'
make examplesfeature.Windows (static) builds not tested.
Also enable examples in a pair of CI jobs.
Apply related updates to the macOS CI workflow:
CXXenvs.-Wno-error=undef -Wno-error=conversionflags.-Wno-deprecated-declarationsto GCC too (forBUILD_EXAMPLES).-Wno-deprecated-declarationsis necessary.Closes #13491