Fix cygwin builds #121
Cygwin claims to be POSIX but only implementes part of the dl_open interface. For this usage, we revert to win32 interface when building on Cygwin.
This commit is contained in:
@@ -147,7 +147,7 @@ endif()
|
|||||||
|
|
||||||
# limitations in MinGW require us to make an optimized build
|
# limitations in MinGW require us to make an optimized build
|
||||||
# for the sake of object sizes or something
|
# for the sake of object sizes or something
|
||||||
if(MINGW)
|
if(MINGW OR CYGWIN)
|
||||||
add_definitions(-O3)
|
add_definitions(-O3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#define CHAISCRIPT_HAS_DECLSPEC
|
#define CHAISCRIPT_HAS_DECLSPEC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#define CHAISCRIPT_WINDOWS
|
#define CHAISCRIPT_WINDOWS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _POSIX_VERSION
|
#if defined(_POSIX_VERSION) && !defined(__CYGWIN__)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#else
|
#else
|
||||||
#ifdef CHAISCRIPT_WINDOWS
|
#ifdef CHAISCRIPT_WINDOWS
|
||||||
@@ -69,7 +69,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
#ifdef _POSIX_VERSION
|
#if defined(_POSIX_VERSION) && !defined(__CYGWIN__)
|
||||||
struct Loadable_Module
|
struct Loadable_Module
|
||||||
{
|
{
|
||||||
struct DLModule
|
struct DLModule
|
||||||
@@ -438,8 +438,7 @@ namespace chaiscript
|
|||||||
m_usepaths.push_back("");
|
m_usepaths.push_back("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_POSIX_VERSION) && !defined(__CYGWIN__)
|
||||||
#ifdef _POSIX_VERSION
|
|
||||||
// If on Unix, add the path of the current executable to the module search path
|
// If on Unix, add the path of the current executable to the module search path
|
||||||
// as windows would do
|
// as windows would do
|
||||||
|
|
||||||
@@ -704,6 +703,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
std::vector<std::string> prefixes;
|
std::vector<std::string> prefixes;
|
||||||
prefixes.push_back("lib");
|
prefixes.push_back("lib");
|
||||||
|
prefixes.push_back("cyg");
|
||||||
prefixes.push_back("");
|
prefixes.push_back("");
|
||||||
|
|
||||||
std::vector<std::string> postfixes;
|
std::vector<std::string> postfixes;
|
||||||
|
Reference in New Issue
Block a user