Adjust the link line for all exe/dlls to prefer onecore_apiset #1240

Closed
opened 2026-01-30 22:19:59 +00:00 by claunia · 2 comments
Owner

Originally created by @DHowett-MSFT on GitHub (May 21, 2019).

dwmapi, winmm, shlwapi are all in different forms on OneCore editions than on desktop, so linking those libs explicitly (instead of via umbrella) is probably not good.

pathcch isn't there at all... so maybe the API we're using through that is available in a different way?

Originally posted by @miniksa in https://github.com/microsoft/terminal/pull/913

Originally created by @DHowett-MSFT on GitHub (May 21, 2019). dwmapi, winmm, shlwapi are all in different forms on OneCore editions than on desktop, so linking those libs explicitly (instead of via umbrella) is probably not good. pathcch isn't there at all... so maybe the API we're using through that is available in a different way? _Originally posted by @miniksa in https://github.com/microsoft/terminal/pull/913_
Author
Owner

@DHowett-MSFT commented on GitHub (May 22, 2019):

Problem description: common.build.exe.or.dll.props specifies the link line, but it is included before common.build.post.props. common.build.post.props includes the toplevel C++ compilation rules which prepend the default libraries to the link line.

It is necessary to do a few things:

  • move all PropertyGroups into .props files
  • move all ItemDefinitionGroups into .targets files
  • rename ...post.props to ...post.targets, as it is a targets file that includes targets files.
  • move all .targets files that define ItemDefinitionGroups that change compilation or linking behavior to after ...post.props

I think it will benefit us to get rid of common.build.exe.props and common.build.dll.props and actually just rely on PropertyGroup.ConfigurationType being Application or DynamicLibrary to include additional rules in post.targets. They're not different enough to warrant saving one property definition that belongs in the project.

A typical project would then become:

Import common.build.props
All ClCompile Entries
All ClInclude Entries
Properties: Name, GUID, Keyword, *ProjectType*
Import common.build.targets
@DHowett-MSFT commented on GitHub (May 22, 2019): Problem description: `common.build.exe.or.dll.props` specifies the link line, but it is included before `common.build.post.props`. `common.build.post.props` includes the toplevel C++ compilation rules which _prepend_ the default libraries to the link line. It is necessary to do a few things: * move all `PropertyGroup`s into `.props` files * move all `ItemDefinitionGroup`s into `.targets` files * rename `...post.props` to `...post.targets`, as it is a targets file that includes targets files. * move all `.targets` files that define `ItemDefinitionGroup`s that change compilation or linking behavior to after `...post.props` I think it will benefit us to get rid of `common.build.exe.props` and `common.build.dll.props` and _actually just rely on `PropertyGroup.ConfigurationType` being `Application` or `DynamicLibrary`_ to include additional rules in `post.targets`. They're not different enough to warrant saving one property definition that belongs in the project. A typical project would then become: ``` Import common.build.props All ClCompile Entries All ClInclude Entries Properties: Name, GUID, Keyword, *ProjectType* Import common.build.targets ```
Author
Owner

@miniksa commented on GitHub (May 22, 2019):

I am OK with this.

@miniksa commented on GitHub (May 22, 2019): I am OK with this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1240