Commits


Sutou Kouhei authored and GitHub committed 72343f53992
GH-35870: [C++] Add support for changing optimization flags with CMAKE_CXX_FLAGS_DEBUG (#35924) ### Rationale for this change `-DCMAKE_CXX_FLAGS_RELEASE=-O...` works with #15022 but `-DCMAKE_CXX_FLAGS_DEBUG=-O...` and `-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` don't work. Because we always specify `-O0` for Debug and RelWithDebInfo. ### What changes are included in this PR? These changes don't specify optimization levels for Debug and RelWithDebInfo unconditionally. We don't specify optimization levels for RelWithDebInfo the default flags include them. We specify `-O0` for Debug only when the default flags don't include any optimization levels. So user specified `CMAKE_CXX_FLAGS_DEBUG=-O...` and `CMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` are used. In addition, `ARROW_C_FLAGS_${CONFIG}` and `ARROW_CXX_FLAGS_${CONFIG}` are introduced. Users can also use `-DARROW_CXX_FLAGS_DEBUG=-O...` instead of `-DCMAKE_CXX_FLAGS_DEBUG=-O...`. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: #35870 Lead-authored-by: Sutou Kouhei <kou@clear-code.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Signed-off-by: Sutou Kouhei <kou@clear-code.com>