Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
endif()

if(CMAKE_BUILD_TYPE MATCHES "Release")
Comment thread
LinZhihao-723 marked this conversation as resolved.
Resolved
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_CHECK_MSG)
Comment thread
LinZhihao-723 marked this conversation as resolved.
Resolved
if(IPO_SUPPORTED)
message(STATUS "Link-time optimization enabled.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif()
else()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

else() branch never closed – CMake will fail to configure

if(CMAKE_BUILD_TYPE MATCHES "Release") opens at L24 and its else() opens at L31, but the corresponding endif() for the outer if() is missing. This breaks block balance and will trigger:

CMake Error: Parse error in command while processing CMakeLists.txt

Add the missing terminator right after the non-Release branch contents:

@@
-else()
-
-set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+# Non-Release builds
+else()
+    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+endif()           # CMAKE_BUILD_TYPE MATCHES "Release"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(CMAKE_BUILD_TYPE MATCHES "Release")
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_CHECK_MSG)
if(IPO_SUPPORTED)
message(STATUS "Link-time optimization enabled.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif()
else()
if(CMAKE_BUILD_TYPE MATCHES "Release")
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_CHECK_MSG)
if(IPO_SUPPORTED)
message(STATUS "Link-time optimization enabled.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif()
# Non-Release builds
else()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif() # CMAKE_BUILD_TYPE MATCHES "Release"
🤖 Prompt for AI Agents
In components/core/CMakeLists.txt around lines 24 to 32, the if-else block
checking for Release build type is missing the closing endif() for the outer if
statement. To fix this, add an endif() after the else() branch content to
properly close the conditional block and prevent CMake configuration errors.

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

# Set general compressor
Expand Down