Transform paths from win32 seps to posix as expected by CMake#132
Transform paths from win32 seps to posix as expected by CMake#132kraenhansen merged 2 commits intomainfrom
Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for converting Win32 path separators to POSIX style in CMakeLists.txt generation for both gyp-to-cmake and weak-node-api. It adds a new transformation option in the gyp-to-cmake transformer and updates the CLI and tests accordingly.
- Added a new boolean option (transformWinPathsToPosix) to control path transformation.
- Updated the command-line interface to support disabling transformation via the "--no-path-transforms" flag.
- Implemented a new helper function in weak-node-api and added tests to verify the behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/gyp-to-cmake/src/transformer.ts | Added transformWinPathsToPosix option and transformPath function |
| packages/gyp-to-cmake/src/transformer.test.ts | Added tests validating that Win32 separators are converted to POSIX |
| packages/gyp-to-cmake/src/cli.ts | Updated CLI option to support disabling path transformation |
| packages/cmake-rn/src/weak-node-api.ts | Added toCmakePath function to convert paths (requires dependency fix) |
Comments suppressed due to low confidence (1)
packages/cmake-rn/src/weak-node-api.ts:15
- The 'path' module is used here without an explicit import. Add 'import path from "node:path";' at the top of the file.
return input.split(path.win32.sep).join(path.posix.sep);
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Cmake expects paths to be using forward slashes as directory separator.
Merging this PR will:
gyp-to-cmakeand when the weak-node-api paths are injected bycmake-rn.