{"id":13599424,"url":"https://github.com/ilammy/msvc-dev-cmd","last_synced_at":"2025-05-15T00:06:41.981Z","repository":{"id":45596214,"uuid":"212181767","full_name":"ilammy/msvc-dev-cmd","owner":"ilammy","description":"GitHub Action to setup Developer Command Prompt for Microsoft Visual C++","archived":false,"fork":false,"pushed_at":"2024-04-01T07:49:17.000Z","size":309,"stargazers_count":367,"open_issues_count":15,"forks_count":53,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-06T19:08:20.181Z","etag":null,"topics":["github-actions","msvc","visual-cpp","windows"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilammy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-01T19:26:10.000Z","updated_at":"2025-05-02T17:05:46.000Z","dependencies_parsed_at":"2023-02-18T20:15:29.242Z","dependency_job_id":"e3d572d3-6bfa-46ee-a1f3-de8282951744","html_url":"https://github.com/ilammy/msvc-dev-cmd","commit_stats":{"total_commits":54,"total_committers":13,"mean_commits":4.153846153846154,"dds":"0.33333333333333337","last_synced_commit":"a742a854f54111d83b78e97091b5d85ccdaa3e89"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilammy%2Fmsvc-dev-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilammy%2Fmsvc-dev-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilammy%2Fmsvc-dev-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilammy%2Fmsvc-dev-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilammy","download_url":"https://codeload.github.com/ilammy/msvc-dev-cmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","msvc","visual-cpp","windows"],"created_at":"2024-08-01T17:01:03.897Z","updated_at":"2025-05-15T00:06:41.900Z","avatar_url":"https://github.com/ilammy.png","language":"JavaScript","readme":"\u003ca href=\"https://github.com/ilammy/msvc-dev-cmd\"\u003e\u003cimg alt=\"GitHub Actions status\" src=\"https://github.com/ilammy/msvc-dev-cmd/workflows/msvc-dev-cmd/badge.svg\"\u003e\u003c/a\u003e\n\n# msvc-dev-cmd\n\n[GitHub Action](https://github.com/features/actions) for configuring Developer Command Prompt for Microsoft Visual C++.\n\nThis sets up the environment for compiling C/C++ code from command line.\n\nSupports Windows. Does nothing on Linux and macOS.\n\n## Example usage\n\nBasic usage for default compilation settings is like this:\n\n```yaml\njobs:\n  test:\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ilammy/msvc-dev-cmd@v1\n      - name: Build something requiring CL.EXE\n        run: |\n          cmake -G \"NMake Makefiles\" .\n          nmake\n      # ...\n```\n\nIf you want something non-default,\nlike using a specific version of Visual Studio,\nor cross-compling for a different target,\nyou will need to configure those settings via inputs:\n\n```yaml\njobs:\n  test:\n    # Run a job for each of the specified target architectures:\n    strategy:\n      matrix:\n        arch:\n          - amd64\n          - amd64_x86\n          - amd64_arm64\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ilammy/msvc-dev-cmd@v1\n        with:\n          arch: ${{ matrix.arch }}\n      - name: Build something requiring CL.EXE\n        run: |\n          cmake -G \"NMake Makefiles\" .\n          nmake\n      # ...\n```\n\n## Inputs\n\n- `arch` – target architecture\n  - native compilation:\n    - `x64` (default) or its synonyms: `amd64`, `win64`, `x86_64`, `x86-64`\n    - `x86` or its synonyms: `win32`\n  - cross-compilation: `x86_amd64`, `x86_arm`, `x86_arm64`, `amd64_x86`, `amd64_arm`, `amd64_arm64`\n- `sdk` – Windows SDK to use\n  - do not specify to use the default SDK\n  - or specify full Windows 10 SDK number (e.g, `10.0.10240.0`)\n  - or write `8.1` to use Windows 8.1 SDK\n- `toolset` – select VC++ compiler toolset version\n  - do not specify to use the default toolset\n  - `14.0` for VC++ 2015 Compiler Toolset\n  - `14.XX` for the latest 14.XX toolset installed (e.g, `14.11`)\n  - `14.XX.YYYYY` for a specific full version number (e.g, `14.11.25503`)\n- `uwp` – set `true` to build for Universal Windows Platform (i.e., for Windows Store)\n- `spectre` – set `true` to use Visual Studio libraries with [Spectre](https://meltdownattack.com) mitigations\n- `vsversion` – the Visual Studio version to use. This can be the version number (e.g. 16.0 for 2019) or the year (e.g. \"2019\"); omit this input to select the latest version of Visual Studio. On [GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners), this input is not required because there is only one Visual Studio in the environment.\n\n## Caveats\n\n### Name conflicts with `shell: bash`\n\nUsing `shell: bash` in Actions may shadow some of the paths added by MSVC.\nIn particular, `link.exe` (Microsoft C linker) is prone to be shadowed by `/usr/bin/link` (GNU filesystem link tool).\n\nUnfortunately, this happens because GitHub Actions unconditionally *prepend* GNU paths when `shell: bash` is used,\non top of any paths set by `msvc-dev-cmd`, every time at the start of each new step.\nHence, there aren't many non-destructive options here.\n\nIf you experience compilation errors where `link` complains about unreasonable command-line arguments,\n“extra operand *something-something*” – that's probably it.\nRecommended workaround is to remove `/usr/bin/link` if that interferes with your builds.\nIf this is not acceptable, please file an issue, then we'll figure out something better.\n\n### Reconfiguration\n\nYou can invoke `ilammy/msvc-dev-cmd` multiple times during your jobs with different inputs\nto reconfigure the environment for building with different settings\n(e.g., to target multiple architectures).\n\n```yaml\njobs:\n  release:\n    steps:\n      # ...\n      - name: Configure build for amd64\n        uses: ilammy/msvc-dev-cmd@v1\n        with:\n          arch: amd64\n\n      - run: build # (for amd64)\n\n      - name: Configure build for x86\n        uses: ilammy/msvc-dev-cmd@v1\n        with:\n          arch: amd64_x86\n\n      - run: build # (for x86)\n\n      - name: Configure build for ARM64\n        uses: ilammy/msvc-dev-cmd@v1\n        with:\n          arch: amd64_arm64\n\n      - run: build # (for ARM64)\n\n      # ...\n```\n\nThis mostly works but it's not really recommended\nsince Developer Command Prompt was not meant for recursive reconfiguration.\nThat said, if it does not work for you, please file an issue.\n\nConsider using [`strategy.matrix`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)\nto execute different build configuration in parallel, independent environments.\n\n## License\n\nMIT, see [LICENSE](LICENSE).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filammy%2Fmsvc-dev-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filammy%2Fmsvc-dev-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filammy%2Fmsvc-dev-cmd/lists"}