[PATCH] Introduce a cmake LLVM_ENABLE_LIBCXX build parameter to compile using libc++ instead of the system default

Jean-Daniel Dupas devlists at shadowlab.org
Mon Dec 16 10:53:04 PST 2013


  ping

  Le 11 déc. 2013 à 14:58, Jean-Daniel Dupas <devlists at shadowlab.org> a écrit :

  >  Introduce a cmake LLVM_ENABLE_LIBCXX build parameter to compile using libc++ instead of the system default.
  >
  > http://llvm-reviews.chandlerc.com/D2381
  >
  > CHANGE SINCE LAST DIFF
  >  http://llvm-reviews.chandlerc.com/D2381?vs=6021&id=6022#toc
  >
  > Files:
  >  CMakeLists.txt
  >  cmake/modules/HandleLLVMOptions.cmake
  >
  > Index: CMakeLists.txt
  > ===================================================================
  > --- CMakeLists.txt
  > +++ CMakeLists.txt
  > @@ -180,6 +180,7 @@
  > endif()
  >
  > option(LLVM_ENABLE_CXX11 "Compile with C++11 enabled." OFF)
  > +option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF)
  > option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
  > option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
  >
  > Index: cmake/modules/HandleLLVMOptions.cmake
  > ===================================================================
  > --- cmake/modules/HandleLLVMOptions.cmake
  > +++ cmake/modules/HandleLLVMOptions.cmake
  > @@ -250,6 +250,13 @@
  >     check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11)
  >     append_if(CXX_SUPPORTS_CXX11 "-std=c++11" CMAKE_CXX_FLAGS)
  >   endif (LLVM_ENABLE_CXX11)
  > +  if(LLVM_ENABLE_LIBCXX)
  > +    check_cxx_compiler_flag("-stdlib=libc++" CXX_SUPPORTS_STDLIB)
  > +    append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_CXX_FLAGS)
  > +    append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_EXE_LINKER_FLAGS)
  > +    append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_SHARED_LINKER_FLAGS)
  > +    append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_MODULE_LINKER_FLAGS)
  > +  endif ()
  > endif( MSVC )
  >
  > macro(append_common_sanitizer_flags)
  > <D2381.2.patch>

  -- Jean-Daniel

http://llvm-reviews.chandlerc.com/D2381



More information about the llvm-commits mailing list