<div dir="ltr"><div><div><div><div><div>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:<br><br></div>set(CMAKE_CXX_STANDARD 11)<br></div>set(CMAKE_CXX_STANDARD_REQUIRED True)<br><br></div>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:<br><br></div>set(CMAKE_POSITION_INDEPENDENT_CODE True)<br><br></div>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.<br><div><div><div><div><div><br clear="all"><div><div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">----------<br>Chuck Atkins<br>Staff R&D Engineer, Scientific Computing<br>Kitware, Inc.<br></div></div></div></div></div></div></div>
</div></div></div></div></div></div></div></div>