Skip to content

Instantly share code, notes, and snippets.

@limadm
Last active May 1, 2016 02:32
Show Gist options
  • Save limadm/639a487949837422485740dbacf09509 to your computer and use it in GitHub Desktop.
Save limadm/639a487949837422485740dbacf09509 to your computer and use it in GitHub Desktop.
diff --git a/cpp/BoostParts/boost/python/detail/wrap_python.hpp b/cpp/BoostParts/boost/python/detail/wrap_python.hpp
index eaef784..f7a8d09 100644
--- a/cpp/BoostParts/boost/python/detail/wrap_python.hpp
+++ b/cpp/BoostParts/boost/python/detail/wrap_python.hpp
@@ -85,7 +85,9 @@
#if defined(_WIN32) || defined(__CYGWIN__)
# if defined(__GNUC__) && defined(__CYGWIN__)
-# define SIZEOF_LONG 4
+# ifndef SIZEOF_LONG
+# define SIZEOF_LONG sizeof(long)
+# endif
# if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 2
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 1e9674e..99d338c 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -154,12 +154,12 @@ endif()
# TODO: remove this when it's fixed upstream (probably boost 1.53).
add_definitions( -DBOOST_THREAD_DONT_USE_CHRONO )
-if( MSVC OR CYGWIN )
+if( MSVC OR CYGWIN OR MSYS )
# BOOST_ALL_NO_LIB turns off MSVC library autolinking
add_definitions( -DBOOST_ALL_NO_LIB )
endif()
-if( WIN32 OR CYGWIN )
+if( WIN32 OR CYGWIN OR MSYS )
# BOOST_PYTHON_SOURCE makes boost use the correct __declspec
add_definitions( -DBOOST_PYTHON_SOURCE -DBOOST_THREAD_USE_LIB )
if ( 64_BIT_PLATFORM )
diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt
index 71dc59f..c1ecc60 100644
--- a/cpp/ycm/CMakeLists.txt
+++ b/cpp/ycm/CMakeLists.txt
@@ -398,7 +398,7 @@ endif()
# for our module
set_target_properties( ${PROJECT_NAME} PROPERTIES PREFIX "")
-if ( WIN32 OR CYGWIN )
+if ( WIN32 OR CYGWIN OR MSYS )
# DLL platforms put dlls in the RUNTIME_OUTPUT_DIRECTORY
# First for the generic no-config case (e.g. with mingw)
set_target_properties( ${PROJECT_NAME} PROPERTIES
@@ -413,7 +413,7 @@ if ( WIN32 OR CYGWIN )
if ( WIN32 )
# This is the extension for compiled Python modules on Windows
set_target_properties( ${PROJECT_NAME} PROPERTIES SUFFIX ".pyd")
- elseif ( CYGWIN )
+ elseif ( CYGWIN OR MSYS )
# This is the extension for compiled Python modules in Cygwin
set_target_properties( ${PROJECT_NAME} PROPERTIES SUFFIX ".dll")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment