[llvm-dev] Leveraging newer CMake features for Language standards
C Bergström via llvm-dev
llvm-dev at lists.llvm.org
Thu Oct 20 09:23:04 PDT 2016
Speaking only from observation - Most likely you'll have to let the
feature bake for a couple of versions until it's easily available in
the main Linux distributions. What version did this become available?
Is there any distro which has it available in the default repo? (Also
is it available on FBSD, Win.. etc)
It can't hurt to propose a bump in minimum cmake version, including
the justification, but if it isn't broke - why fix it?
------------
On this feature specifically, I question how robust it will be in
figuring out if c++11 or other c++ standard is *really* supported.
Does it internally include some complex hello world or just check for
flags available.. etc... How will TR be handled? What versions are
currently supported?
On Thu, Oct 20, 2016 at 11:49 PM, Chuck Atkins via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> LLVM currently has CMake code to try to detect the various options needed to
> compile with C++11 support that has been around since prior to the CMake
> version bump. One of the nicer features that came with the newer required
> CMake version is that very thing. Rather than try to discern this yourself
> CMake has the CXX_STANDARD and CXX_STANDARD_REQUIRED target properties. If
> set appropriately on a given target then the approiate compiler flags for
> that language standard as known by CMake with be applied. You can set the
> global default for this by defining in teh cop level CMakeLists.txt:
>
> set(CMAKE_CXX_STANDARD 11)
> set(CMAKE_CXX_STANDARD_REQUIRED True)
>
> Unrelated but in a similar situation is the -fPIC flag. The
> POSITION_INDEPENDENT_CODE target proeprty is available, which can be
> initialized toa default value with:
>
> set(CMAKE_POSITION_INDEPENDENT_CODE True)
>
> What are peoples thoughts about reducing HandleLLVMOptions.cmake to factor
> out and leverage options that CMake already knows about and knows how to
> apply? I wanted to put a bit of time into this but didn't want to spin my
> wheels if there were major objections to idea.
>
> ----------
> Chuck Atkins
> Staff R&D Engineer, Scientific Computing
> Kitware, Inc.
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
More information about the llvm-dev
mailing list