From e7774cf44b3dfd9ddec268c2bc7dfcc4406b15bf Mon Sep 17 00:00:00 2001 From: Chris Hoffman Date: Fri, 15 Feb 2013 22:18:09 -0600 Subject: [PATCH 1/2] Get cygwin compilation working --- cpp/BoostParts/CMakeLists.txt | 2 +- cpp/ycm/CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cpp/BoostParts/CMakeLists.txt b/cpp/BoostParts/CMakeLists.txt index 216bd52f..7fd78ecb 100644 --- a/cpp/BoostParts/CMakeLists.txt +++ b/cpp/BoostParts/CMakeLists.txt @@ -86,7 +86,7 @@ endif() # TODO: remove this when it's fixed upstream (probably boost 1.53). add_definitions( -DBOOST_THREAD_DONT_USE_CHRONO ) -if( MSVC ) +if( MSVC OR CYGWIN ) # BOOST_PYTHON_SOURCE makes boost use the correct __declspec and # BOOST_ALL_NO_LIB turns off MSVC library autolinking add_definitions( -DBOOST_PYTHON_SOURCE -DBOOST_ALL_NO_LIB ) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index 92b7bf47..0ef618bd 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -218,6 +218,11 @@ endif() # TODO: remove this when it's fixed upstream (probably boost 1.53). add_definitions( -DBOOST_THREAD_DONT_USE_CHRONO ) +if( MSVC OR CYGWIN ) + # BOOST_PYTHON_SOURCE makes boost use the correct __declspec and + # BOOST_ALL_NO_LIB turns off MSVC library autolinking + add_definitions( -DBOOST_PYTHON_SOURCE -DBOOST_ALL_NO_LIB ) +endif() ############################################################################# add_library( ${PROJECT_NAME} SHARED @@ -268,7 +273,7 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES PREFIX "") # 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, but it # will recognize a .so -if ( NOT WIN32 ) +if ( NOT WIN32 AND NOT CYGWIN ) set_target_properties( ${PROJECT_NAME} PROPERTIES SUFFIX ".so") endif() From ee943d717395bdd78b981c2366579d8febb9e713 Mon Sep 17 00:00:00 2001 From: Chris Hoffman Date: Fri, 15 Feb 2013 22:24:52 -0600 Subject: [PATCH 2/2] Add missing option for ycm_core to be a dll --- plugin/youcompleteme.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 6eadd5cc..01b28290 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -39,6 +39,8 @@ function! s:HasYcmCore() let path_prefix = s:script_folder_path . '/../python/' if filereadable(path_prefix . 'ycm_core.so') return 1 + elseif filereadable(path_prefix . 'ycm_core.dll') + return 1 elseif filereadable(path_prefix . 'ycm_core.pyd') return 1 endif