Support linking with static runtime library (PR #22693)

73 views
Skip to first unread message

David Connet

unread,
Aug 1, 2022, 2:31:03 PM8/1/22
to wx-...@googlegroups.com, Subscribed

Create a macro to specify the RuntimeLibrary. This allows a user to create wx libs that are statically linking to the VC runtime by specifying the static versions in wx_local.props via

    <wxReleaseRuntimeLibrary>MultiThreaded</wxReleaseRuntimeLibrary>
    <wxDebugRuntimeLibrary>MultiThreadedDebug</wxDebugRuntimeLibrary>

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/22693

Commit Summary

  • 910476a Support linking with static runtime library

File Changes

(24 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693@github.com>

VZ

unread,
Aug 1, 2022, 2:36:34 PM8/1/22
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks, I barely had time to post my reply to your message on the list when this PR already came in, like by magic.

I'm ready to apply it as is, but I think it could be nicer to have a single wxRuntimeLibs property as suggested below, what do you think?


In build/msw/wx_setup.props:

> +    <BuildMacro Include="wxIntRootDir">
+      <Value>$(wxIntRootDir)</Value>
+    </BuildMacro>

This seems to have been duplicated accidentally?


In build/msw/wx_setup.props:

> +    <wxReleaseRuntimeLibrary>MultiThreadedDLL</wxReleaseRuntimeLibrary>
+    <wxDebugRuntimeLibrary>MultiThreadedDebugDLL</wxDebugRuntimeLibrary>

Could we perhaps define wxRuntimeLibs and check below if it's dynamic (default value) or static and set these 2 automatically? It looks like it would be more consistent with the make option used currently and simpler to use.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1057700305@github.com>

David Connet

unread,
Aug 1, 2022, 3:11:56 PM8/1/22
to wx-...@googlegroups.com, Subscribed

@dconnet commented on this pull request.


In build/msw/wx_setup.props:

> +    <BuildMacro Include="wxIntRootDir">
+      <Value>$(wxIntRootDir)</Value>
+    </BuildMacro>

Oops, yes it was...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1057739831@github.com>

David Connet

unread,
Aug 1, 2022, 3:21:16 PM8/1/22
to wx-...@googlegroups.com, Push

@dconnet pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/push/10606416988@github.com>

David Connet

unread,
Aug 1, 2022, 3:24:02 PM8/1/22
to wx-...@googlegroups.com, Subscribed

@dconnet commented on this pull request.


In build/msw/wx_setup.props:

> +    <wxReleaseRuntimeLibrary>MultiThreadedDLL</wxReleaseRuntimeLibrary>
+    <wxDebugRuntimeLibrary>MultiThreadedDebugDLL</wxDebugRuntimeLibrary>

I think I understand what you mean here. Let me see what I can come up with...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1057746475@github.com>

David Connet

unread,
Aug 1, 2022, 3:45:24 PM8/1/22
to wx-...@googlegroups.com, Push

@dconnet pushed 1 commit.

  • 318e9a1 Use wxRuntimeLibs macro set to 'static' or 'dynamic'


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/push/10606608943@github.com>

David Connet

unread,
Aug 3, 2022, 12:50:46 PM8/3/22
to wx-...@googlegroups.com, Subscribed

@dconnet commented on this pull request.


In build/msw/wx_setup.props:

> +    <wxReleaseRuntimeLibrary>MultiThreadedDLL</wxReleaseRuntimeLibrary>
+    <wxDebugRuntimeLibrary>MultiThreadedDebugDLL</wxDebugRuntimeLibrary>

Forgot to mention - this is ready now.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1060706041@github.com>

VZ

unread,
Aug 3, 2022, 3:56:28 PM8/3/22
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks, I'm, again, ready to apply this as is, but I'm afraid I've made you make more changes than I wanted to, I just thought that you'd use the test to set the variables in the .props file, i.e. still use $(wx{Debug,Release}RuntimeLibrary) as you did in the first version, but set them depending on the $(wxRuntimeLibs) value.

I am not sure if this is better or worse than the current version, but if we don't use $(wx{Debug,Release}RuntimeLibrary) we shouldn't define them -- and if we do, we shouldn't hardcode MultiThreaded{Debug,Release}{,DLL} names.

Or am I missing something here?


In build/msw/wx_setup.props:

> +    <BuildMacro Include="wxReleaseRuntimeLibrary">
+      <Value>$(wxReleaseRuntimeLibrary)</Value>
+    </BuildMacro>
+    <BuildMacro Include="wxDebugRuntimeLibrary">
+      <Value>$(wxDebugRuntimeLibrary)</Value>
+    </BuildMacro>

This seems to be unused?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1060924490@github.com>

David Connet

unread,
Aug 3, 2022, 4:20:30 PM8/3/22
to wx-...@googlegroups.com, Subscribed

@dconnet commented on this pull request.


In build/msw/wx_setup.props:

> +    <BuildMacro Include="wxReleaseRuntimeLibrary">
+      <Value>$(wxReleaseRuntimeLibrary)</Value>
+    </BuildMacro>
+    <BuildMacro Include="wxDebugRuntimeLibrary">
+      <Value>$(wxDebugRuntimeLibrary)</Value>
+    </BuildMacro>

Ah, I understand better! I'll change to that (which will make these used)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1060952872@github.com>

David Connet

unread,
Aug 3, 2022, 4:58:42 PM8/3/22
to wx-...@googlegroups.com, Push

@dconnet pushed 1 commit.

  • a633b2d Use wxRuntimeLibs macro set to wxReleaseRuntimeLibrary, wxDebugRuntimeLibrary.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/push/10630049544@github.com>

David Connet

unread,
Aug 3, 2022, 5:00:45 PM8/3/22
to wx-...@googlegroups.com, Subscribed

@dconnet commented on this pull request.


In build/msw/wx_setup.props:

> +    <BuildMacro Include="wxReleaseRuntimeLibrary">
+      <Value>$(wxReleaseRuntimeLibrary)</Value>
+    </BuildMacro>
+    <BuildMacro Include="wxDebugRuntimeLibrary">
+      <Value>$(wxDebugRuntimeLibrary)</Value>
+    </BuildMacro>

Modified to use wxReleaseRuntimeLibrary/wxDebugRuntimeLibrary in vcxproj files (the original way), plus use wxRuntimeLibs in wx_setup to set initial values. Default is /MD. Setting wxRuntimeLibs to 'static' will use /MT (any other value will leave the setting at /MD)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/review/1061004892@github.com>

VZ

unread,
Aug 3, 2022, 8:25:00 PM8/3/22
to wx-...@googlegroups.com, Subscribed

Perfect, thanks! Will merge soon.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/c1204619926@github.com>

VZ

unread,
Aug 3, 2022, 8:50:38 PM8/3/22
to wx-...@googlegroups.com, Subscribed

Closed #22693 via f94676f.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22693/issue_event/7123731397@github.com>

Reply all
Reply to author
Forward
0 new messages