Skip to content

fix(cmake): fix LOWERCASE_BUILD_TYPE definition and usage#180

Merged
zjw1111 merged 1 commit intoalibaba:mainfrom
mrdrivingduck:fix/cmake-lowercase-build-type
Mar 16, 2026
Merged

fix(cmake): fix LOWERCASE_BUILD_TYPE definition and usage#180
zjw1111 merged 1 commit intoalibaba:mainfrom
mrdrivingduck:fix/cmake-lowercase-build-type

Conversation

@mrdrivingduck
Copy link
Contributor

This commit fixes several issues with the CMAKE_BUILD_TYPE_LOWER variable in ThirdpartyToolchain.cmake:

  1. Duplicate definitions

    • Line 1094 in Arrow build section
    • Line 1315 in TBB build section
  2. Use-before-definition bug

    • Line 1304 used the variable before it was defined on line 1315
    • This caused the condition check to fail in TBB build section
  3. Inconsistent naming

    • The file already defines UPPERCASE_BUILD_TYPE at line 32
    • But uses CMAKE_BUILD_TYPE_LOWER instead of LOWERCASE_BUILD_TYPE

The fix consolidates the definition at the top of the file (line 33), right after UPPERCASE_BUILD_TYPE, and renames it to LOWERCASE_BUILD_TYPE for consistency.

Changes:

  • Add LOWERCASE_BUILD_TYPE definition at line 33
  • Remove duplicate definitions at lines 1094 and 1315
  • Rename all CMAKE_BUILD_TYPE_LOWER references to LOWERCASE_BUILD_TYPE (9 occurrences)

Affected build macros: build_arrow(), build_gtest(), build_tbb()

This commit fixes several issues with CMAKE_BUILD_TYPE_LOWER variable:

1. Duplicate definitions: The variable was defined twice in the file
   - Line 1094 in Arrow build section
   - Line 1315 in TBB build section

2. Use-before-definition bug: In TBB section, line 1304 used the
   variable before it was defined on line 1315

3. Inconsistent naming: Renamed CMAKE_BUILD_TYPE_LOWER to
   LOWERCASE_BUILD_TYPE to match the naming style of
   UPPERCASE_BUILD_TYPE

The fix consolidates the definition at the top of the file (line 33),
right after UPPERCASE_BUILD_TYPE, ensuring it's available throughout
the file and following a consistent naming convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 15, 2026 07:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes inconsistent and incorrect handling of the lowercased build type in ThirdpartyToolchain.cmake by introducing a single, consistently named LOWERCASE_BUILD_TYPE variable and updating all relevant references.

Changes:

  • Define LOWERCASE_BUILD_TYPE once near the top of ThirdpartyToolchain.cmake.
  • Remove duplicate CMAKE_BUILD_TYPE_LOWER definitions in the Arrow and TBB sections.
  • Replace CMAKE_BUILD_TYPE_LOWER usages with LOWERCASE_BUILD_TYPE in Arrow/GTest/TBB logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Collaborator

@zjw1111 zjw1111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@zjw1111 zjw1111 merged commit d893e0b into alibaba:main Mar 16, 2026
11 of 12 checks passed
@mrdrivingduck mrdrivingduck deleted the fix/cmake-lowercase-build-type branch March 16, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants