Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformToolset 指定をプロパティーシートに分離して VS2017 および VS2019 で両対応できるようにする #866

Conversation

m-tmatma
Copy link
Member

PlatformToolset を別ファイルに分離して VS2017 および VS2019 で両対応できるようにする

https://qiita.com/yumetodo/items/a8324efaf83c9c08d168

@m-tmatma m-tmatma added the enhancement ■機能追加 label Apr 26, 2019
@m-tmatma m-tmatma added this to the v2.4.0 milestone Apr 26, 2019
@berryzplus
Copy link
Contributor

v141とかv142とかの話ですね。

vs2017 = v141
vs2019 = v142

現状はv141です。

v141にしとくとvs2019で開くときに「アップグレードしますか?」と訊かれるので「いいえ」とすればOKです。両方インストールされた環境では、vs2019で開いてもvs2017で開いてもvs2017のC++コンパイラが使われます。v142にアップグレードすると、ビルド時にvs2019のC++コンパイラが使われるようになります。代償としてvs2017ではプロジェクトを開けなくなります。

対策としては msbuild のパラメータに /p:PlatformToolkit=v142 などと指定する代案も考えられます。

@berryzplus
Copy link
Contributor

PlatformToolsetですね。

@berryzplus
Copy link
Contributor

この方法で対処するなら props の置き場はルート以外が良いです。

@m-tmatma
Copy link
Member Author

この方法で対処するなら props の置き場はルート以外が良いです。

対応しました。
ドキュメントも更新しました。

- [Visual Studio Community 2019](https://www.visualstudio.com/downloads/)

Visual Studio 2017/2019 の両対応に関しては #866 で対処済みです。
[仕組みに関してはこちらを参照](vcx-props/project-PlatformToolset.md)
Copy link
Member Author

Choose a reason for hiding this comment

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

ちなみにこの PR 上でこちらのリンクをクリックすると not found になるのは master を見に行くからです。
PR がマージされたらいけるはず。ローカルで visual studio code の preview 機能でリンクをたどるといけました。

HeaderMake/HeaderMake.vcxproj Outdated Show resolved Hide resolved
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
Copy link
Contributor

Choose a reason for hiding this comment

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

メモ:このままにしとくとvs2019だけをインストールしたマシンで そんなtoolsetねーよ! と怒られます。また、vs2017とvs2019の両方が入ったマシンでは、vs2019でビルドしてもvs2017のC++コンパイラが使われます。


現状では Visual Studio Community 2017 を使用しています。

- [Visual Studio Community 2017](https://visualstudio.microsoft.com/vs/older-downloads/)
Copy link
Contributor

Choose a reason for hiding this comment

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

メモ:リンクは最新版(=vs2019)に置き換わってるのでついでに対応が必要。

@berryzplus
Copy link
Contributor

この方法で対処するなら props の置き場はルート以外が良いです。

対応しました。

確認しました。対応ありがとうございます。

review comment で書き忘れましたが、$(ProjectDir)$(SolutionDir) の末尾は / であることが保証されるので $(ProjectDir)..\vcx-props\vcxcompat.props と書くことができます。testsプロジェクトのようにルート以外に配置するプロジェクトがあるので $(SolutionDir)vcx-props\vcxcompat.props がいいんですけど 😄

@m-tmatma
Copy link
Member Author

eview comment で書き忘れましたが、$(ProjectDir)$(SolutionDir) の末尾は / であることが保証されるので $(ProjectDir)..\vcx-props\vcxcompat.props と書くことができます。

それは知ってますが、明示的に \ をつけたほうがわかりやすいんじゃないかと思ってそうしました。
一応修正しておきます。

@m-tmatma
Copy link
Member Author

review comment で書き忘れましたが、$(ProjectDir)$(SolutionDir) の末尾は / であることが保証されるので $(ProjectDir)..\vcx-props\vcxcompat.props と書くことができます。

修正しました。

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

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

LGTMです。

@m-tmatma m-tmatma changed the title PlatformToolset を別ファイルに分離して VS2017 および VS2019 で両対応できるようにする PlatformToolset 指定をプロパティーシートに分離して VS2017 および VS2019 で両対応できるようにする Apr 27, 2019
@m-tmatma m-tmatma merged commit fc75418 into sakura-editor:master Apr 27, 2019
@m-tmatma m-tmatma deleted the feature/divide-platform-toolset-to-separate-file branch April 27, 2019 20:37
m-tmatma added a commit to m-tmatma/sakura that referenced this pull request Apr 28, 2019
m-tmatma added a commit that referenced this pull request Apr 28, 2019
README.md の #866 の PR に対するリンクを修正
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
…tform-toolset-to-separate-file

PlatformToolset 指定をプロパティーシートに分離して VS2017 および VS2019 で両対応できるようにする
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
…link

README.md の sakura-editor#866 の PR に対するリンクを修正
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ■機能追加
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants