(Plugin) Module only compile on certain Platforms

Hi all!
I have a Plugin that has 2 modules, one of which uses platform specific SDK code (steam). That plugin should only be compiled for its supported platforms (Win64, Linux, Max), not on e.g. consoles.

This is in my .uplugin file:
"Modules":
[
{
"Name": "VDPlatformUtils",
"Type": "Runtime",
"LoadingPhase": "Default"
},
{
"Name": "VDPlatformUtilsSteam",
"Type": "Runtime",
"LoadingPhase": "Default",
"PlatformAllowList": [ "Win64", "Linux", "Mac" ]
}
],
"Plugins": [
{
"Name": "OnlineSubsystem",
"Enabled": true
}
]

VDPlatformUtilsSteam is still being compiled for unsupported platforms, causing a compile error.
There are no dependencies on this module anywhere that I can think of. Can someone tell me why this happens?

As a workaround I am currently using

#define WITH_STEAM (PLATFORM_WINDOWS || PLATFORM_LINUX || PLATFORM_MAC)

in all files that include any of the third party headers which works, yes, but it’s not my ideal. Ideally that module shouldn’t be compiled at all on unsupported platforms. The platform specific online subsystems can do it so how can I?

Thanks!