Skip to content

Add public CMake, Visual Studio, and compile database improvements - #1

Merged
onurpaca merged 6 commits into
mainfrom
agent/public-devtools-features
Aug 12, 2026
Merged

onurpaca merged 6 commits into
mainfrom
agent/public-devtools-features

Conversation

@onurpaca

Copy link
Copy Markdown
Owner

What changed

  • add public Visual Studio solution and standalone CMake generators
  • improve compile_commands.json with probed toolchain system include paths
  • accept format_all --fix without forwarding an invalid flag
  • fix Stardoc dependency wiring for the new public macros
  • add hermetic tests for CMake, Visual Studio, compile database, and format argument handling
  • add SHA-pinned Linux/Windows GitHub Actions CI
  • refresh the module lockfile and README usage example

Why

The public GitHub repository was behind the general-purpose improvements developed downstream. This brings over only reusable behavior; SPGM registry, Gitea publishing, internal network configuration, and organization-specific hooks are intentionally excluded.

Root cause of the build failure

cc_devtools.bzl loaded the new cmake.bzl and vs_solution.bzl modules, but docs/BUILD.bazel did not declare their bzl_library nodes as Stardoc dependencies. Bazel therefore rejected //docs:all during analysis.

Validation

  • Gitleaks 8.30.1: working tree and all six PR commits, no leaks found
  • bazel test //tests:all --test_output=errors: 2/2 targets passed
  • bazel build //:all //cc:all //format_all:all //lint_all:all: 31 targets passed on Windows
  • Buildifier check for changed Bazel files passed
  • git diff --check passed
  • no new SPGM, Gitea, internal-IP, registry-token, or organization-hook references in the PR diff

Stardoc now passes analysis locally. Its action execution is Linux-only in CI because the upstream Stardoc Maven rules invoke Bash and the local Windows machine has no WSL.

onurpaca and others added 6 commits August 12, 2026 13:43
…targets

Adds a vs_solution tool that scans cc_binary/cc_library/cc_test targets and
writes a Visual Studio solution at the workspace root (<name>.sln plus one
.vcxproj/.vcxproj.filters per target under vs_projects/) for opening a Bazel
workspace in full Visual Studio.

- NMake/Makefile projects: Build/Rebuild/Clean shell out to bazel; Debug maps
  to -c dbg, Release to -c opt.
- IntelliSense (include paths, defines, forced includes, compiler options) is
  sourced from compile_commands.json; build-only flags are stripped and every
  IntelliSense-relevant flag is forwarded. The sibling compile_commands target
  is refreshed first automatically (refresh_compile_commands, default on).
- cc_binary/cc_test get NMakeOutput + LocalDebuggerCommand pointing at the
  bazel-bin executable for F5 debugging.
- Each target's direct external-dependency headers are listed under an
  "External Dependencies\<repo>" filter in Solution Explorer.

Wired into the cc_devtools bundle and the @devtools extension, exposing a
vs_solution_name configure attribute.
…gets

Adds a cmake tool that reads cc_library/cc_binary/cc_test build attributes
(bazel query --output=xml) and emits a standalone CMakeLists.txt for Bazel-native
projects whose users or community consume them via CMake.

- cc_library -> add_library (STATIC, or INTERFACE when header-only);
  cc_binary/cc_test -> add_executable.
- strip_include_prefix/includes -> target_include_directories; copts ->
  compiler-guarded target_compile_options (GCC/Clang vs MSVC); defines ->
  target_compile_definitions.
- intra-repo deps -> target_link_libraries; implicit toolchain deps dropped;
  curated external deps (googletest) -> find_package-or-FetchContent;
  cc_test -> CTest with gtest_discover_tests.
- No silent gaps: genrules and generated headers, select() branches lost to the
  current platform, and unmapped external deps are emitted as # TODO(bazel2cmake)
  comments and reported on the console — the output is a starting point a
  maintainer finishes, not a guaranteed build.

Wired into the cc_devtools bundle and the @devtools extension.
…ge-consumable

Public cc_library targets now get install(TARGETS ... EXPORT) with GNUInstallDirs
destinations, install(DIRECTORY <include>/), an install(EXPORT) under a <proj>::
namespace, and a generated <proj>Config.cmake.in + version file via
CMakePackageConfigHelpers. target_include_directories gains an INSTALL_INTERFACE,
and project() carries VERSION read from MODULE.bazel.

Downstream consumers can now find_package(<proj>) and link <proj>::<lib>. External
deps that exported libraries expose are emitted as find_dependency() in the config.
…ror (#7)

Co-authored-by: onur <onurpaca@gmail.com>
Co-committed-by: onur <onurpaca@gmail.com>
@onurpaca
onurpaca marked this pull request as ready for review August 12, 2026 11:13
@onurpaca
onurpaca merged commit 7411206 into main Aug 12, 2026
2 checks passed
@onurpaca
onurpaca deleted the agent/public-devtools-features branch August 12, 2026 11:26
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.

1 participant