hello,
is it possible to compile interface library only and target it in another "project" to make compilable by interface rules but without linking library physically?
since windows swift cannot link static library, there is no need to link libraries defining protocol / base class / ...
what i have discovered so far is the only option to build library:
add_library(BLA SHARED librarySource.swift) -> dll, lib, swiftmodule (interface i quess)
and consumer links dynamic only this way:
add_library(BaseClassInLibSwift SHARED IMPORTED)
set_target_properties(BaseClassInLibSwift PROPERTIES IMPORTED_IMPLIB pathTo.lib)
set_target_properties(BaseClassInLibSwift PROPERTIES IMPORTED_LOCATION pathTo.dll)
set_target_properties(BaseClassInLibSwift PROPERTIES INTERFACE_INCLUDE_DIRECTORIES pathToFolderWhere.swiftmodule exists)
target_link_libraries(MyProject PUBLIC BaseClassInLibSwift)
only using PROPERTIES INTERFACE_INCLUDE_DIRECTORIES allows me to declare "import MYMODULE_REPRESENTING_LIBRARY" in my target swift file
- static library only does not work
- shared library requires IMPORTED_IMPLIB path to lib file too
- .swiftmodule must be present
is it possible to generate INTERFACE library (compiler does not generate anything when calling add_library(A INTERACE B) - i would expected at least .swiftmodule file
AND
link only this interface using something like
set_target_properties(BaseClassInLibSwift PROPERTIES INTERFACE_INCLUDE_DIRECTORIES pathToFolderWhere.swiftmodule exists
there is no need to have physically dll or lib when dll is shared and external and allready compiled
thank you very much