]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cmake: fix StdFilesystem detection
authorKefu Chai <kchai@redhat.com>
Thu, 2 Aug 2018 05:45:51 +0000 (13:45 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 2 Aug 2018 06:37:49 +0000 (14:37 +0800)
commitbbd95765cc0a4d4f66d5767a08b687d7369a1e0e
tree58d6ae00e32323371b82d5e256ce874816f82e43
parent0912caefa9bb8ebe0e126e44be5539e5db595233
cmake: fix StdFilesystem detection

before this change, we fails to detect std::filesystem with clang++,
because  the cmake project created by try_compile() only expands
following options passed from its caller:
- COMPILE_DEFINITIONS
- INCLUDE_DIRECTORIES
- LINK_DIRECTORIES
- LINK_LIBRARIES

which do not include CMAKE_CXX_FLAGS, so either we need to (ab)use
COMPILE_DEFINITIONS for passing -std=c++17, or we can change the
CMAKE_CXX_FLAGS in the parent env, as it turns out the created cmake
project does inherit this flag from current project. in this change,
we use the COMPILE_DEFINITIONS approach: simpler this way. and we
can drop it once cmake 3.8 is required.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/FindStdFilesystem.cmake