Skip to content

fix: use MSBuildProjectDirectory for vcpkg paths#194

Merged
majestyotbr merged 1 commit into
mainfrom
fix-vcpkg-paths
Jun 5, 2026
Merged

fix: use MSBuildProjectDirectory for vcpkg paths#194
majestyotbr merged 1 commit into
mainfrom
fix-vcpkg-paths

Conversation

@majestyotbr

@majestyotbr majestyotbr commented Jun 5, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Chores
    • Updated internal build configuration and project settings for improved build consistency across different platforms and configurations.
    • Enhanced source file organization and protobuf code generation infrastructure.
    • Refined third-party dependency integration and build system tooling.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Visual Studio project file (RME.vcxproj) is updated with standardized compiler and linker configurations across all build variants, new source files for networking and database components, revised protobuf code generation wiring, and normalized vcpkg build system integration.

Changes

RME Project Build Configuration Update

Layer / File(s) Summary
Compiler and linker configurations
vcproj/Project/RME.vcxproj
Vcpkg path for x64 builds now uses absolute $(MSBuildProjectDirectory)\vcpkg_installed instead of relative paths. Debug|x64, Release|Win32, and Release|x64 configuration blocks updated with revised include directories, preprocessor definitions, runtime library settings, and link dependency lists.
New source file entries
vcproj/Project/RME.vcxproj
Project ItemGroup extended with networking/RNG components (live_socket, live_tab, map_region, object_pool, mt_rand) and brush/materials database sources (brush_database, materials, sqlite_materials_inspector).
Protobuf code generation wiring
vcproj/Project/RME.vcxproj
MSBuild RunProtoCompile/ProtoCompile target rewritten to conditionally execute protoc using $(ProtocPath) and $(ProtoPath) properties and emit generated C++ into the generated directory.
Build system integration
vcproj/Project/RME.vcxproj
Vcpkg targets import condition updated to explicitly check $(_ZVcpkgRoot) and $(VcpkgRoot) properties; DownloadFastNoiseLite target closure preserved.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

  • opentibiabr/remeres-map-editor#154: Addresses similar vcpkg/protobuf build wiring in the project file, including vcpkg_installed path normalization and generated code include ordering.

Poem

🐰 New files hop into the build,
Compiler flags are carefully tugged,
Vcpkg paths now crystal clear,
Protobuf generation brought near,
The project stands proud and well-built! 🏗️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change in the pull request - updating vcpkg paths to use MSBuildProjectDirectory instead of relative paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 fix-vcpkg-paths

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the MSBuild project file RME.vcxproj to use $(MSBuildProjectDirectory) for the VcpkgInstalledDir path across all configurations and refactors the vcpkg targets import condition. The reviewer suggested consolidating the duplicate VcpkgInstalledDir definitions into a single common property group to simplify the project file and reduce duplication.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread vcproj/Project/RME.vcxproj

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
vcproj/Project/RME.vcxproj (2)

544-577: ⚡ Quick win

Verify protoc availability before invoking.

The ProtoCompile target at line 567 invokes protoc using $(ProtocPath) which is constructed from $(VcpkgInstalledDir). If vcpkg installation fails or is incomplete, the Exec command will produce a cryptic error.

The dependency on VcpkgInstallManifestDependencies (line 558) should ensure protoc is installed, but consider adding an explicit existence check or a more informative error message if protoc is missing.

💡 Optional: Add explicit validation

Add a validation target before ProtoCompile:

<Target Name="ValidateProtocPath" BeforeTargets="ProtoCompile" Condition="'$(RunProtoCompile)'=='true'">
  <Error Text="Protoc not found at $(ProtocPath). Ensure vcpkg has installed protobuf." 
         Condition="!Exists('$(ProtocPath)')" />
</Target>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@vcproj/Project/RME.vcxproj` around lines 544 - 577, Add an explicit
validation step to fail fast if protoc is missing: create a new Target (e.g.,
ValidateProtocPath) that runs BeforeTargets="ProtoCompile" and is conditioned on
"'$(RunProtoCompile)'=='true'"; inside it check Exists('$(ProtocPath)') and emit
an Error with a clear message if the file is not found. Hook this before the
existing ProtoCompile target so ProtoCompile (which uses $(ProtocPath)) only
runs when protoc is present; keep the existing VcpkgInstallManifestDependencies
dependency but add this check to provide a clearer failure message.

169-169: 💤 Low value

Inconsistent indentation: tabs vs spaces.

Lines 169 and 242 use tab characters for indentation, while surrounding lines use spaces. Consider normalizing to match the project's convention (spaces appear to be the standard based on the rest of the file).

🧹 Proposed fix for consistency

For Line 169:

-	  %(AdditionalIncludeDirectories)
+      %(AdditionalIncludeDirectories)

For Line 242:

-	  %(AdditionalIncludeDirectories)
+      %(AdditionalIncludeDirectories)

Also applies to: 242-242

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@vcproj/Project/RME.vcxproj` at line 169, The file contains mixed tabs and
spaces around the "%(AdditionalIncludeDirectories)" entries causing inconsistent
indentation; replace the tab characters used for indentation at those
"%(AdditionalIncludeDirectories)" occurrences with the project's standard spaces
so indenting matches surrounding lines and formatting tools — locate the
"%(AdditionalIncludeDirectories)" tokens in the project XML and convert leading
tabs to the same number of spaces used elsewhere in the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@vcproj/Project/RME.vcxproj`:
- Around line 544-577: Add an explicit validation step to fail fast if protoc is
missing: create a new Target (e.g., ValidateProtocPath) that runs
BeforeTargets="ProtoCompile" and is conditioned on
"'$(RunProtoCompile)'=='true'"; inside it check Exists('$(ProtocPath)') and emit
an Error with a clear message if the file is not found. Hook this before the
existing ProtoCompile target so ProtoCompile (which uses $(ProtocPath)) only
runs when protoc is present; keep the existing VcpkgInstallManifestDependencies
dependency but add this check to provide a clearer failure message.
- Line 169: The file contains mixed tabs and spaces around the
"%(AdditionalIncludeDirectories)" entries causing inconsistent indentation;
replace the tab characters used for indentation at those
"%(AdditionalIncludeDirectories)" occurrences with the project's standard spaces
so indenting matches surrounding lines and formatting tools — locate the
"%(AdditionalIncludeDirectories)" tokens in the project XML and convert leading
tabs to the same number of spaces used elsewhere in the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f3525ce2-7d03-460f-8533-78ed68892a4a

📥 Commits

Reviewing files that changed from the base of the PR and between a526945 and f135783.

📒 Files selected for processing (1)
  • vcproj/Project/RME.vcxproj

@majestyotbr majestyotbr merged commit e0761f7 into main Jun 5, 2026
13 checks passed
@majestyotbr majestyotbr deleted the fix-vcpkg-paths branch June 5, 2026 13:54
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.

2 participants