Three more Windows build fixes (#4356)

* - fixes MinGW build
- make sure that supplier istream is opened in binary mode or istream::tellg() will
  report wrong offsets on MinGW builds (MSVC will make no difference)
- avoid that in MSVC conda DLL builds the libboost_*.lib static
  libraries are picked by cmake instead of the boost_*.lib import libraries
  by defining BOOST_ALL_DYN_LINK

* - make sure that C# wrappers build with MinGW compilers
- make sure that static builds work under Windows with both MSVC and
  MinGW

* - disable building static libraries on Windows also when using MinGW compilers
- fix the C# wrapper build on Windows under both MSVC and MinGW

* reverted -DSWIGWORDSIZE64 as it was originally

* reverted -DSWIGWORDSIZE64 definition

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
This commit is contained in:
Paolo Tosco
2021-07-29 05:52:18 +02:00
committed by GitHub
parent 660ffa3b76
commit e8175cf29c
5 changed files with 14 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ SET(CMAKE_SWIG_FLAGS "")
set(swigRDKitLibSuffix "")
if(RDK_SWIG_STATIC AND ((NOT MSVC) OR (MSVC AND RDK_INSTALL_DLLS_MSVC)))
if(RDK_SWIG_STATIC AND (NOT WIN32))
set(swigRDKitLibSuffix "_static")
endif()
set(swigRDKitLibList "")

View File

@@ -3,19 +3,19 @@ project (GraphMolCSharp)
include_directories( ${RDKit_ExternalDir} )
# find the mcs executables on non-windows systems:
if(NOT WIN32)
if(NOT MSVC)
find_program(GMCS_EXE mcs)
if (NOT GMCS_EXE)
MESSAGE ("mcs (executable) is not found. Please add it to PATH and rerun cmake.")
MESSAGE(FATAL_ERROR "Cannot find required executable mcs")
endif (NOT GMCS_EXE)
endif(NOT WIN32)
endif(NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(GraphMolCSharp.i PROPERTIES CPLUSPLUS ON )
# Setup a few variables for environment-specific things
if(WIN32)
if(MSVC)
ADD_COMPILE_OPTIONS(/W3 /wd4716 /bigobj)
SET(PATH_SEP ";")
SET(COPY_CMD xcopy ${COPY_SOURCE} ${COPY_DEST} /Y /I)
@@ -35,7 +35,7 @@ else()
if (WIN32)
SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64" "-DSWIGWIN")
else()
SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64")
SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64")
endif()
endif()
SET(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_SOURCE_DIR}/swig_csharp )
@@ -76,7 +76,7 @@ INSTALL(TARGETS RDKFuncs
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} )
if(NOT WIN32)
if(NOT MSVC)
# code adapted from the wrapper code for
# GDCM: http://gdcm.svn.sf.net/viewvc/gdcm/trunk/Wrapping/Java/CMakeLists.txt?view=markup
ADD_CUSTOM_COMMAND(
@@ -93,4 +93,4 @@ if(NOT WIN32)
DEPENDS RDKFuncs ${CMAKE_CURRENT_SOURCE_DIR}/RDKit2DotNet.dll
COMMENT "building mono dll"
)
endif(NOT WIN32)
endif(NOT MSVC)