-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUILD.md: ensure build_type and CMAKE_BUILD_TYPE match #5274
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5274 +/- ##
=========================================
- Coverage 78.1% 78.1% -0.0%
=========================================
Files 790 790
Lines 67556 67556
Branches 8158 8159 +1
=========================================
- Hits 52785 52784 -1
- Misses 14771 14772 +1 |
BUILD.md
Outdated
``` | ||
conan install .. --output-folder . --build missing --settings build_type=Release | ||
conan install .. --output-folder . --build missing --settings build_type=Debug | ||
``` | ||
|
||
To build Debug, set `build_type=Debug` (instead of Release) and in the next step, set `-DCMAKE_BUILD_TYPE=Debug` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about including both conan install
commands?
conan install .. --output-folder . --build missing --settings build_type=Release
conan install .. --output-folder . --build missing --settings build_type=Debug
or even nerdier
for type in Release Debug
do
conan install .. --output-folder . --build missing --settings build_type=${type}
done
Most developers should be able to build rippled with either setting, and this has them ready for both. If they don't want both, it's more obvious (IMHO) to leave a command out than it is to add a second one if they do. Worst case, they waste the extra time and disk space for something they don't need, but the time is only wasted once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. I moved this line up, since it's what I missed the first time:
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
and make sure it matches the `build_type` setting you chose in the previous
step.
Co-authored-by: Ed Hennis <ed@ripple.com>
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type] | ||
and make sure it matches the `build_type` setting you chose in the previous | ||
step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how nitpicky I want to be about this. If you build both configurations, as the example above shows, conan is smart enough to combine the outputs in the toolchain file, and you can successfully build with either value in CMAKE_BUILD_TYPE
. In other words, you don't necessarily have to wipe the build directory in between to choose one conan config or the other.
I think this is clear enough as-is, but consider:
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type] | |
and make sure it matches the `build_type` setting you chose in the previous | |
step. | |
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type] | |
and make sure it matches the one of the `build_type` settings | |
you chose in the previous step. |
High Level Overview of Change
Running these will result in an error:
conan install .. --output-folder . --build missing --settings build_type=Debug
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -Dxrpld=ON -Dtests=ON ..
cmake --build .
The build instructions provided 2
conan install
lines with different build_type settings, but the "obvious"cmake
line used only 1 of them.Context of Change
In addition to me, I have seen at least 2 other engineers run into this exact same error.
Type of Change
.gitignore
, formatting, dropping support for older tooling)