-
Notifications
You must be signed in to change notification settings - Fork 163
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
言語DLLのMakefileのMYDEFINESの指定方法をシンプルに戻す #1389
言語DLLのMakefileのMYDEFINESの指定方法をシンプルに戻す #1389
Conversation
ifeq (_DEBUG,$(findstring _DEBUG,$(MYDEFINES))) | ||
else ifeq (NDEBUG,$(findstring NDEBUG,$(MYDEFINES))) | ||
ifeq (-D_DEBUG,$(findstring -D_DEBUG,$(MYDEFINES))) | ||
else ifeq (-DNDEBUG,$(findstring -DNDEBUG,$(MYDEFINES))) | ||
else | ||
MYDEFINES += NDEBUG | ||
MYDEFINES += -DNDEBUG | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NDEBUG
ってリソースファイルの中では使っていないような気がするのですが、このブロック必要ですか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使ってませんが、あったほうがより良いと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本体の Makefile にもこの部分はないですが、追加する予定でしょうか。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あったほうが良い理由は、MSVC側のReleaseビルドで指定されるフラグだからです。
パターンは4つあって、実質的に使われるのは2つですが NDEBUG
を指定しなくてよい理由はない気がします。
-- | _DEBUG | NDEBUG |
---|---|---|
Debugビルド | 定義あり | 定義なし |
Releaseビルド | 定義なし | 定義あり |
ありえない1 | 定義なし | 定義なし |
ありえない2 | 定義あり | 定義あり |
このブロックにより ありえない1
の発生を排除することができます。
ありえない2
の排除は無理だと思うので放置します。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本体の Makefile にはこの部分がなくて、言語 DLL の方にだけあるのは統一が取れていないので、両方から削除するか、両方に追加するかどちらかにした方がいいのでは?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本体の Makefile にはこの部分がなくて、言語 DLL の方にだけあるのは統一が取れていないので、両方から削除するか、両方に追加するかどちらかにした方がいいのでは?
本体に追加したいです。
それはいつか別PRで対処したいです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いまやっときます?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
別PRでいいでしょう。
方針が決まらなければ、このブロックが必要かどうかの判断ができないので聞いただけのことです。
✅ Build sakura 1.0.3061 completed (commit bc44ae29e5 by @berryzplus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
レビューありがとうございます。マージしちゃいます。 |
よく考えたら、 ifeq (,$(findstring -D_DEBUG,$(MYDEFINES)))
ifeq (,$(findstring -DNDEBUG,$(MYDEFINES)))
MYDEFINES += -DNDEBUG
endif
endif |
んではそれで修正しときます。別PRになるので本体側も合わせて変更したいと思います。 |
別PR作って、テストのところで再チェックしてて、 |
PR の目的
言語DLLのMakefileのMYDEFINESの指定方法をシンプルに戻して、
build-gnu.bat
を修正しなくて済むようにします。カテゴリ
PR の背景
#1386
MinGW: Refactor Makefile for Language DLL
リソースの
Debug/Release
指定漏れを防止するために、_DEBUG
かNDEBUG
が必ず指定されるようにする仕組みを言語DLLのMakefileに入れました。↓
#1381
テストバッチの辻褄を合わせる
Originally posted by @berryzplus in #1381 (comment)
PR のメリット
言語DLLのビルドを
build-gnu.bat
に組み込む際にbuild-gnu.bat
を修正しなくて済むようになります。PR のデメリット (トレードオフとかあれば)
たぶん、ないです。
仕様・動作説明
MYDEFINES
のチェック方法を変更します。_DEBUG
かNDEBUG
のいずれかが指定されているかチェック、なければNDEBUG
指定とみなす。-D_DEBUG
か-DNDEBUG
のいずれかが指定されているかチェック、なければ-DNDEBUG
指定とみなす。テスト内容
MYDEFINESの指定を変えてMinGWの言語DLLをビルドして、生成されたDLLを
visual studio
で開き、埋め込まれたアイコンリソースに問題ないことを確認しました。mingw32-make -f ../../../sakura_lang_en_US/Makefile MYDEFINES= SAKURA_CORE=. OUTDIR=. -j8
MYDEFINES
指定なし、Release版になるのでサクラアイコン(ID=210)がピンク。mingw32-make -f ../../../sakura_lang_en_US/Makefile MYDEFINES=-D_DEBUG SAKURA_CORE=. OUTDIR=. -j8
MYDEFINES=-D_DEBUG
Debug版になるのでサクラアイコン(ID=210)が青。mingw32-make -f ../../../sakura_lang_en_US/Makefile MYDEFINES=-DNDEBUG SAKURA_CORE=. OUTDIR=. -j8
MYDEFINES=-DNDEBUG
Release版になるのでサクラアイコン(ID=210)がピンク。PR の影響範囲
MinGWの言語DLLのビルドに影響します。
関連 issue, PR
#1386
MinGW: Refactor Makefile for Language DLL
参考資料