Search code examples
flutterflutter-pluginflutter-desktop

How to add linker additional dependencies into flutter desktop plugin for windows


I want to use CredUIPromptForWindowsCredentialsW function from windows api. But it require me add "Credui.lib" to linker additional dependencies.

With Visual studio we can go to Properties > Linker > All Options > Additional Dependencies then add it.

I saw it added to vcxproj file.

But with flutter plugin I can not see any file .sln or file .vcxproj, It is only auto generated by fullter.

How can I config linker file to flutter plugin ? In additional, How can we open windows folder as a project using Visual Studio as android folder using Android studio ?


Solution

  • Windows plugin builds are based on CMake, so you would use target_link_libraries in your plugin's CMakeLists.txt to add a library dependency.