0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PowerShellで64ビット開発環境

Posted at

はじめに

Qt6.2がLTSになったのと Windows11が出たので開発環境を64ビットにシフトしようと考えたのが発端
今迄は32ビットのビルド環境だったので Windows Terminal の PowerShell から次のスクリプトを実行する事で開発環境の設定が可能だった

${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Launch-VsDevShell.ps1

がこれだと32ビットのビルド環境なのでQt6.2がビルドできない
これのパラメータでアーキテクチャが指定できるか読んでみても分からなかった
ググった結果 設定できたので記します

前提

次の開発環境がターゲット

  • Windows 10 x64
  • PowerShell
  • Build Tools for Visual Studio 2019

準備

この方法ではインスタンスIDが必要なので インスタンスID 取ります

  1. [スタート]→[Visual Studio 2019]→[Developer PowerShell for VS2019] のコンテキストメニューを表示
  2. [その他]→[ファイルの場所を開く]を選択

    image.png
  3. ショートカットの格納先フォルダが表示されるので 該当ショートカットのプロパティを表示

    image.png

1. [ショートカット]ページの[リンク先]の値にインスタンスIDが含まれていて xxxxxxxx がそれ

実行

次のスクリプトをPowerShellのプロンプトに流してあげればok

& {Import-Module "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"; Enter-VsDevShell インスタンスID -DevCmdArguments -arch=x64}

インスタンスIDは書き換えて書き換えて

以下 実行例

PS C:\Users\username> & {Import-Module "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"; Enter-VsDevShell インスタンスID -DevCmdArguments -arch=x64}
**********************************************************************
** Visual Studio 2019 Developer PowerShell v16.11.6
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
PS C:\Users\username> cmd /c where cl
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe

所感

これで漸くQt6.2での開発が出来そうです♪

参考・感謝

次のページがを参考にさせて頂きました!感謝!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?