Skip to content

feat: Adding CMakesLists.txt and src/main.cpp#2

Merged
c5ln merged 3 commits intomainfrom
feat/1-adding-cmakeliststxt-and-maincpp-for-test
Mar 22, 2026
Merged

feat: Adding CMakesLists.txt and src/main.cpp#2
c5ln merged 3 commits intomainfrom
feat/1-adding-cmakeliststxt-and-maincpp-for-test

Conversation

@c5ln
Copy link
Copy Markdown
Owner

@c5ln c5ln commented Mar 22, 2026

Summary

What does this PR do?

Adding 'CMakeLists.txt' and 'src/main.cpp'

Changes

  • src/main.cpp
  • CMakeLists.txt

Related Issue

Closes #1

Checklist

  • Code compiles without errors
  • Self-reviewed the diff
  • No unintended files included

@c5ln c5ln requested a review from seojeongm March 22, 2026 06:14
@c5ln c5ln self-assigned this Mar 22, 2026
@c5ln c5ln added the feature New feature or request label Mar 22, 2026
@c5ln c5ln linked an issue Mar 22, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8520165f-b504-46f6-a332-243289b950ea

📥 Commits

Reviewing files that changed from the base of the PR and between 212a8b8 and dedcd53.

📒 Files selected for processing (1)
  • .coderabbit.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .coderabbit.yaml

📝 Walkthrough

Walkthrough

Adds a top-level CMake build and a minimal C++ entry point. The new CMakeLists.txt uses FetchContent to fetch/build tree-sitter (and python grammar), SDL3, imgui, and imnodes, then defines a Telescode executable from src/main.cpp. src/main.cpp provides an empty main and an extern for the Python grammar.

Changes

Cohort / File(s) Summary
Build Configuration
CMakeLists.txt
New top-level CMake project (C++17) using FetchContent to fetch/build: tree-sitter (lib), tree-sitter-python (static from parser.c/scanner.c, links to tree-sitter), SDL3 (static), imgui (static with SDL3/OpenGL3 backends), imnodes (static). Finds OpenGL and defines add_executable(Telescode ...) linking those targets.
Application Entry Point
src/main.cpp
New minimal C++ entry file including SDL3/ImGui/imnodes/tree-sitter headers, declares extern "C" const TSLanguage *tree_sitter_python();, and defines int main() returning 0.
CI / Tooling Config
.coderabbit.yaml
Updated reviews config shape: reviews.auto_review changed from boolean to object form with enabled: true and drafts: false.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding CMakeLists.txt and src/main.cpp files to set up the build system.
Description check ✅ Passed The description follows the required template with all major sections completed: Summary, Changes, Related Issue, and Checklist all filled out appropriately.
Linked Issues check ✅ Passed The PR successfully implements the requirements from issue #1: CMakeLists.txt with multi-dependency build configuration and src/main.cpp entry point are provided, supporting the specified cmake workflow.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #1 requirements. The .coderabbit.yaml update is a minor configuration adjustment unrelated to the core objective but not problematic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/1-adding-cmakeliststxt-and-maincpp-for-test

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
CMakeLists.txt (1)

85-87: Consider making IMGUI_DEFINE_MATH_OPERATORS public for dependent targets.

IMGUI_DEFINE_MATH_OPERATORS is defined as PRIVATE on imnodes, but this macro affects ImGui's ImVec2/ImVec4 operator overloads. If code using imnodes (like src/main.cpp in future) also operates on ImGui math types, inconsistent definitions could cause ODR violations or compilation errors.

Consider defining it on the imgui target instead, where it applies to all ImGui consumers:

Suggested improvement
 target_link_libraries(imgui PUBLIC SDL3::SDL3-static)
+target_compile_definitions(imgui PUBLIC IMGUI_DEFINE_MATH_OPERATORS)
 
 # ── imnodes static library ────────────────────────────────────────────────────
 add_library(imnodes STATIC
     ${imnodes_SOURCE_DIR}/imnodes.cpp
 )
 target_include_directories(imnodes PUBLIC ${imnodes_SOURCE_DIR})
-target_compile_definitions(imnodes PRIVATE IMGUI_DEFINE_MATH_OPERATORS)
 target_link_libraries(imnodes PUBLIC imgui)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` around lines 85 - 87, The macro IMGUI_DEFINE_MATH_OPERATORS
is currently added PRIVATE to the imnodes target; move or add this define so it
applies to all ImGui consumers to avoid ODR/compile issues—either change the
target_compile_definitions call for imnodes to PUBLIC
(target_compile_definitions(imnodes PUBLIC IMGUI_DEFINE_MATH_OPERATORS)) or
preferably add the define on the imgui target instead
(target_compile_definitions(imgui PUBLIC IMGUI_DEFINE_MATH_OPERATORS)) so all
targets linking imgui see the same definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@CMakeLists.txt`:
- Around line 85-87: The macro IMGUI_DEFINE_MATH_OPERATORS is currently added
PRIVATE to the imnodes target; move or add this define so it applies to all
ImGui consumers to avoid ODR/compile issues—either change the
target_compile_definitions call for imnodes to PUBLIC
(target_compile_definitions(imnodes PUBLIC IMGUI_DEFINE_MATH_OPERATORS)) or
preferably add the define on the imgui target instead
(target_compile_definitions(imgui PUBLIC IMGUI_DEFINE_MATH_OPERATORS)) so all
targets linking imgui see the same definition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c9e82b6-fca4-4975-9efd-7fd444a78b45

📥 Commits

Reviewing files that changed from the base of the PR and between 94f9064 and 655e667.

📒 Files selected for processing (2)
  • CMakeLists.txt
  • src/main.cpp

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.coderabbit.yaml:
- Around line 8-11: Remove the invalid top-level reviews.drafts entry and keep
only the nested drafts under reviews.auto_review; specifically delete the legacy
"drafts: false" that sits directly under "reviews" and ensure "auto_review:
enabled: true / drafts: false" remains as the authoritative setting (look for
keys "reviews.drafts" vs "reviews.auto_review.drafts" in the diff and remove the
former).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3484e4fa-0656-44b6-aa69-f43e6e372d8e

📥 Commits

Reviewing files that changed from the base of the PR and between 655e667 and 212a8b8.

📒 Files selected for processing (1)
  • .coderabbit.yaml

Comment thread .coderabbit.yaml Outdated
@c5ln c5ln merged commit e915981 into main Mar 22, 2026
1 check passed
@c5ln c5ln deleted the feat/1-adding-cmakeliststxt-and-maincpp-for-test branch March 22, 2026 06:28
@c5ln c5ln mentioned this pull request Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Adding 'CMakeLists.txt' and 'main.cpp' for test

1 participant