-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Description
When building flutter_windows_unittests.exe
, we get the following linker warnings:
[5860/5960] LINK ./flutter_windows_unittests.exe
b'flutter_windows_unittests.flutter_windows_unittests.obj : warning LNK4217: locally defined symbol FlutterDesktopEngineCreate imported in function "private: virtual void __cdecl flutter::testing::FlutterWindowsTest_GetTextureRegistrar_Test::TestBody(void)" (?TestBody@FlutterWindowsTest_GetTextureRegistrar_Test@testing@flutter@@EEAAXXZ)\r\n'
b'flutter_windows_unittests.flutter_windows_unittests.obj : warning LNK4217: locally defined symbol FlutterDesktopEngineGetTextureRegistrar imported in function "private: virtual void __cdecl flutter::testing::FlutterWindowsTest_GetTextureRegistrar_Test::TestBody(void)" (?TestBody@FlutterWindowsTest_GetTextureRegistrar_Test@testing@flutter@@EEAAXXZ)\r\n'
b'flutter_windows_unittests.flutter_windows_unittests.obj : warning LNK4217: locally defined symbol FlutterDesktopEngineDestroy imported in function "private: virtual void __cdecl flutter::testing::FlutterWindowsTest_GetTextureRegistrar_Test::TestBody(void)" (?TestBody@FlutterWindowsTest_GetTextureRegistrar_Test@testing@flutter@@EEAAXXZ)\r\n'
I accidentally introduced these in flutter/engine#35106 where I landed a parameter type fix for the declaration of FlutterDesktopEngineGetTextureRegistrar
in our public Windows C API. I also added a unit test that called this function.
That function (and all others) in our public Windows API is marked FLUTTER_EXPORT
, which resolves to __declspec(dllexport)
or __declspec(dllimport)
depending on whether FLUTTER_DESKTOP_LIBRARY
is defined. It can be defined by adding the following build config: //flutter/shell/platform/common:desktop_library_implementation
If the function is marked as an import, we get linker warnings that
we're importing a function that's defined in the same executable image. We should either define it as a no-op or as an export (which doesn't matter since it's just a unit tests) to fix the warnings.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status