vcプロジェクトをコピってアーカイブ(Win)
1. 7zipをインストールしておく
2. 除外するファイルのリストを作っておく
.git\ .bin\ .tmp\ .vs\ .orig .vcxproj.user
3. コピーしてアーカイブするbatを書く
xcopy /S /E /H /R /Y /I /EXCLUDE:copyignore.txt mylib .tmp\mylib cd .tmp "C:\Program Files\7-Zip\7z.exe" a hoge\mylib.zip mylib
VS2017ではunionの暗黙デフォルトコンストラクタは作られない
C++ Visual Studioビルド時スタイライズ&スタイルチェック
Visual Studio2017でclang-formatが使えるようになってた
dungeonneko.hatenablog.com
インストールするもの
AStyle
Win版を落としてbinフォルダのAStyle.exeを適当な場所にコピー https://sourceforge.net/projects/astyle/files/
cpplint
pip install cpplint
どちらにもパスを通しておいたほうが楽
VCプロジェクト設定
ビルドイベント -> ビルド前のイベント -> コマンドライン
astyle --style=google --recursive "$(ProjectDir)\*.cpp,*.hpp,*.h" cpplint --output=vs7 --recursive "$(ProjectDir)"
基本はこんな感じ。astyleで文字数改行オプションが効かなかったりするのでuncrustifyを試してみたいと思う。
時代に逆らう人のためのregファイル
最近のWindows Updateが気にくわない
Windows Registry Editor Version 5.00 // コマンドウインドウをここに開くを追加 [HKEY_CLASSES_ROOT\directory\background\shell\CommandPrompt] @="@shell32.dll,-8506" "Extended"="" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOT\directory\background\shell\CommandPrompt\command] @="cmd.exe /s /k pushd \"%V\"" [HKEY_CLASSES_ROOT\directory\shell\CommandPrompt] @="@shell32.dll,-8506" "Extended"="" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOT\directory\shell\CommandPrompt\command] @="cmd.exe /s /k pushd \"%V\"" // Windows SearchでBing検索と位置情報とコルタナを無効化 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] "BingSearchEnabled"=dword:00000000 "AllowSearchToUseLocation"=dword:00000000 "CortanaConsent"=dword:00000000 // 起動時にPin設定を求められないようにする [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PassportForWork] "Enabled"=dword:00000000
pip install PySide2
いつの間にかPySide2がpip installできるようになっているではありませんか
msbuild (Visual Studio) で並列ビルドが効かない場合
ビルドルールが違うものは並列に実行されないっぽい。例えば同じファイル名のcppが複数あるプロジェクトで出力オブジェクトファイル名を変更していたりするとこの問題にハマることがある。