Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ endforeach()

add_systemc_library(systemc SC_BUILD_OFF STATIC ${SYSTEMC_SC_MAIN_SRC} )

add_library(systemc_if INTERFACE)
target_link_libraries(systemc_if INTERFACE systemc systemc-${SystemCLanguage_VERSION})


if (MSVC) # lib.exe should be available from MSVC command promt

add_custom_command(
Expand All @@ -481,18 +485,21 @@ endforeach()
add_custom_command(
TARGET systemc
POST_BUILD
COMMAND ar x $<TARGET_FILE:systemc>
COMMAND ar x $<TARGET_LINKER_FILE:${SYSTEMC_DLL_TARGET}>
COMMAND del *.a
COMMAND ar qc $<TARGET_FILE:systemc> *.o *.obj
COMMAND del *.o *.obj
COMMAND ${CMAKE_COMMAND} -E echo "CREATE $<TARGET_FILE:systemc>" > merge_script.mri
COMMAND ${CMAKE_COMMAND} -E echo "ADDLIB $<TARGET_FILE:systemc>" >> merge_script.mri
COMMAND ${CMAKE_COMMAND} -E echo "ADDLIB $<TARGET_LINKER_FILE:${SYSTEMC_DLL_TARGET}>" >> merge_script.mri
COMMAND ${CMAKE_COMMAND} -E echo "SAVE" >> merge_script.mri
COMMAND ${CMAKE_COMMAND} -E echo "END" >> merge_script.mri
COMMAND ar -M < merge_script.mri
COMMAND ${CMAKE_COMMAND} -E remove merge_script.mri
COMMENT "Combining SystemC libs..."
)

endif(MSVC)

set(SYSTEMC_TARGETS systemc ${SYSTEMC_DLL_TARGET})
set(SYSTEMC_TARGETS systemc_if systemc ${SYSTEMC_DLL_TARGET})

add_library(SystemC::systemc ALIAS systemc_if)
else(BUILD_SHARED_LIBS AND (WIN32 OR CYGWIN))

add_systemc_library(systemc
Expand All @@ -504,9 +511,9 @@ else(BUILD_SHARED_LIBS AND (WIN32 OR CYGWIN))

set(SYSTEMC_TARGETS systemc)

add_library(SystemC::systemc ALIAS systemc)
endif(BUILD_SHARED_LIBS AND (WIN32 OR CYGWIN))

add_library(SystemC::systemc ALIAS systemc)

install(TARGETS ${SYSTEMC_TARGETS} EXPORT SystemCLanguageTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
6 changes: 1 addition & 5 deletions src/sysc/datatypes/int/sc_signed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,7 @@ void
sc_signed::dump(::std::ostream& os) const
{
// Save the current setting, and set the base to decimal.
#if defined(__MINGW32__)
std::_Ios_Fmtflags old_flags = os.setf(::std::ios::dec,::std::ios::basefield);
#else
fmtflags old_flags = os.setf(::std::ios::dec, ::std::ios::basefield);
#endif
auto old_flags = os.setf(::std::ios::dec, ::std::ios::basefield);

os << "width = " << length() << ::std::endl;
os << "value = " << *this << ::std::endl;
Expand Down
6 changes: 1 addition & 5 deletions src/sysc/datatypes/int/sc_unsigned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,7 @@ void
sc_unsigned::dump(::std::ostream& os) const
{
// Save the current setting, and set the base to decimal.
#if defined(__MINGW32__)
std::_Ios_Fmtflags old_flags = os.setf(::std::ios::dec,::std::ios::basefield);
#else
fmtflags old_flags = os.setf(::std::ios::dec, ::std::ios::basefield);
#endif
auto old_flags = os.setf(::std::ios::dec, ::std::ios::basefield);

os << "width = " << length() << ::std::endl;
os << "value = " << *this << ::std::endl;
Expand Down