-
Notifications
You must be signed in to change notification settings - Fork 189
Windows: Refactor DLL creation on Cygwin/MinGW env #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Refactor DLL creation on Cygwin/MinGW env #128
Conversation
This patch removes conditional type for os.setf(), which was failing on msys2 llvm environment and replaces it by auto type. Signed-off-by: Jerome Haxhiaj <[email protected]>
|
This pull-requests depends on #127 |
Windows DLLs can't contain unresolved symbols. Therefore systemc, when built with MSYS2, is split in two libraries: libsystemc-<version>.dll without unresolved symbols and libsystemc.a with unresolved symbols. Currently, cmake target systemc (exposing libsystemc.a) is aliased as SystemC::systemc This leads to a situation where projects that depend SystemC::systemc would link only against the systemc.a and drop the dll. This commit introduces the interface target library `systemc_if`, which links against systemc dll and static and is aliased as SystemC::systemc. To insure backward compatiblity, this mechanism is enabled only when systemc is built as a shared library This commits reworks the sections that merges libsystemc.a and libsystemc-<version>.dll.a
42cb9d0 to
036b9e3
Compare
|
Tested SystemC DLL creation and usage successfully on Win11, using CMake 3.31.1 and MSVC compiler 16.11 ("Visual Studio 16 2019"). My recommendation is to merge |
maehne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed changes make sense to me. However, is the generated library name really libsystemc-.dll on your platform? According to the CMakeLists.txt, the dash should be followed by the SystemC language version extracted from sc_ver.h.
IMHO, the changes to sc_signed.cpp and sc_unsigned.cpp are not topical, but a welcome clean up.
|
Hi @maehne |
maehne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
|
I confirm the name of the generated DLL is correct: |
Windows DLLs can't contain unresolved symbols. Therefore systemc,
when built with MSYS2, is split in two libraries: libsystemc-.dll
without unresolved symbols and libsystemc.a with unresolved symbols.
Currently, cmake target systemc (exposing libsystemc.a) is aliased as SystemC::systemc
This leads to a situation where projects that depend SystemC::systemc
would link only against the systemc.a and drop the dll.
This commit introduces the interface target library
systemc_if,which links against systemc dll and static and is aliased as SystemC::systemc.
To insure backward compatiblity, this mechanism is enabled only
when systemc is built as a shared library
This commits reworks the sections that merges
libsystemc.a and libsystemc-VER.dll.a