diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7de7e714..13b16449 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -16,6 +16,13 @@ # along with YouCompleteMe. If not, see . cmake_minimum_required( VERSION 2.8 ) + +# Disable CMake legacy mode for Cygwin, since the build doesn't depend on +# WIN32 being set for Cygwin, and this property being unset causes a +# warning in Cygwin. +# Remove when CMake >= 2.8.4 is required, since that implicitly sets this +set( CMAKE_LEGACY_CYGWIN_WIN32 0 ) + project( YouCompleteMe ) option( UNIVERSAL "Build universal mac binary" OFF ) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index b7bbbe53..ff35f783 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -318,9 +318,21 @@ set_target_properties( ${CLIENT_LIB} PROPERTIES PREFIX "") set_target_properties( ${SERVER_LIB} PROPERTIES PREFIX "") if ( WIN32 OR CYGWIN ) - # This is the extension for compiled Python modules on Windows - set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".pyd") - set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".pyd") + # DLL platforms put dlls in the RUNTIME_OUTPUT_DIRECTORY + set_target_properties( ${CLIENT_LIB} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../../python ) + set_target_properties( ${SERVER_LIB} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../../python ) + + if ( WIN32 ) + # This is the extension for compiled Python modules on Windows + set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".pyd") + set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".pyd") + elseif ( CYGWIN ) + # This is the extension for compiled Python modules in Cygwin + set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".dll") + set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".dll") + endif() else() # Even on macs, we want a .so extension instead of a .dylib which is what # cmake would give us by default. Python won't recognize a .dylib as a module,