diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-27 06:27:28 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-27 06:27:28 +0000 |
commit | 41029d1e7692cf41e0e4e0eec7cc33b2949e2cf0 (patch) | |
tree | f8fee531118fa47ddfa3d8e90d5ad966a78d7343 /src/cython/CMakeLists.txt | |
parent | be6997e1cb3b7e6feeb3ece37437f02e6c60a18b (diff) | |
parent | 979de853d97225b2b5466ec0a896a06dd08325e9 (diff) |
Merge Copyright clarification
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3402 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: c24c2226a76df7a6a95d2531e98850c7c19580e1
Diffstat (limited to 'src/cython/CMakeLists.txt')
-rw-r--r-- | src/cython/CMakeLists.txt | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index afca9d60..b19cc550 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 2.8) project(Cython) +include(CheckCXXSourceCompiles) + function( add_gudhi_cython_lib THE_LIB ) if(EXISTS ${THE_LIB}) get_filename_component(THE_LIB_FILE_NAME ${THE_LIB} NAME_WE) @@ -32,35 +34,6 @@ if(CYTHON_FOUND) set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DBOOST_ALL_NO_LIB', ") set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DBOOST_SYSTEM_NO_DEPRECATED', ") - # This is because of https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/tss.h - # CGAL is using boost thread if thread_local is not ready (requires XCode 8 for Mac). - # The test in https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/config.h - # #if __has_feature(cxx_thread_local) || \ - # ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \ - # ( _MSC_VER >= 1900 ) - # #define CGAL_CAN_USE_CXX11_THREAD_LOCAL - # #endif - set(CGAL_CAN_USE_CXX11_THREAD_LOCAL " - int main() { - #ifndef __has_feature - #define __has_feature(x) 0 // Compatibility with non-clang compilers. - #endif - #if __has_feature(cxx_thread_local) || \ - ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \ - ( _MSC_VER >= 1900 ) - bool has_feature_thread_local = true; - #else - // Explicit error of compilation for CMake test purpose - has_feature_thread_local is not defined - #endif - bool result = has_feature_thread_local; - } ") - check_cxx_source_compiles("${CGAL_CAN_USE_CXX11_THREAD_LOCAL}" CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT) - - if (NOT CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT) - add_gudhi_cython_lib(${Boost_THREAD_LIBRARY}) - set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${Boost_LIBRARY_DIRS}', ") - endif() - # Gudhi and CGAL compilation option if(MSVC) set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'/fp:strict', ") @@ -99,6 +72,35 @@ if(CYTHON_FOUND) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) if(CGAL_FOUND) + # This is because of https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/tss.h + # CGAL is using boost thread if thread_local is not ready (requires XCode 8 for Mac). + # The test in https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/config.h + # #if __has_feature(cxx_thread_local) || \ + # ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \ + # ( _MSC_VER >= 1900 ) + # #define CGAL_CAN_USE_CXX11_THREAD_LOCAL + # #endif + set(CGAL_CAN_USE_CXX11_THREAD_LOCAL " + int main() { + #ifndef __has_feature + #define __has_feature(x) 0 // Compatibility with non-clang compilers. + #endif + #if __has_feature(cxx_thread_local) || \ + ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \ + ( _MSC_VER >= 1900 ) + bool has_feature_thread_local = true; + #else + // Explicit error of compilation for CMake test purpose - has_feature_thread_local is not defined + #endif + bool result = has_feature_thread_local; + } ") + check_cxx_source_compiles("${CGAL_CAN_USE_CXX11_THREAD_LOCAL}" CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT) + + if (NOT CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT) + add_gudhi_cython_lib(${Boost_THREAD_LIBRARY}) + set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${Boost_LIBRARY_DIRS}', ") + endif() + # Add CGAL compilation args if(CGAL_HEADER_ONLY) set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DCGAL_HEADER_ONLY', ") @@ -135,7 +137,7 @@ if(CYTHON_FOUND) endforeach() set(GUDHI_CYTHON_INCLUDE_DIRS "${GUDHI_CYTHON_INCLUDE_DIRS}'${CMAKE_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/include', ") - if (TBB_FOUND) + if (TBB_FOUND AND WITH_GUDHI_USE_TBB) set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DGUDHI_USE_TBB', ") add_gudhi_cython_lib(${TBB_RELEASE_LIBRARY}) add_gudhi_cython_lib(${TBB_MALLOC_RELEASE_LIBRARY}) |