From Alberto Luaces, "Cygwin's cmake build adds a "d" postfix to the plugins installed in debug

mode. Nevertheless, the code doesn't acknowledge that, so I had problems with
debug versions of the library not being able to open their plugins whereas
the release versions worked fine.

I have made the same changes in Registry.cpp that are available for the rest
of platforms appending that "d" to their plugins. I have also updated the
CMakeLists.txt file to get "_DEBUG" defined at compilation time. I have
copied the already existent conditional block because of cmake's bizarre
operator precedence. Since Cygwin defines both CYGWIN and WIN32, the
following would suffice:

IF(CYGWIN OR UNIX AND NOT WIN32 AND NOT APPLE)

Sadly, it actually doesn't work, so I wrote a new conditional block just for
Cygwin. I could join the two blocks when the parentheses support is added in
newer versions of cmake."
This commit is contained in:
Robert Osfield
2008-09-17 18:56:59 +00:00
parent ff119b78cd
commit 377a553295
2 changed files with 10 additions and 1 deletions

View File

@@ -435,6 +435,11 @@ IF(UNIX AND NOT WIN32 AND NOT APPLE)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(CYGWIN)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS("-D_DEBUG")
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ENDIF(CYGWIN)
IF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")

View File

@@ -622,7 +622,11 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext)
#endif
#if defined(__CYGWIN__)
return prepend+"cygwin_"+"osgdb_"+lowercase_ext+".dll";
#ifdef _DEBUG
return prepend+"cygwin_"+"osgdb_"+lowercase_ext+OSG_DEBUG_POSTFIX+".dll";
#else
return prepend+"cygwin_"+"osgdb_"+lowercase_ext+".dll";
#endif
#elif defined(__MINGW32__)
return prepend+"mingw_"+"osgdb_"+lowercase_ext+".dll";
#elif defined(WIN32)