• Adam Simpkins's avatar
    cmake: find threads before applying compiler settings · d949df1f
    Adam Simpkins authored
    Summary:
    In D10405960 I moved folly-deps.cmake to be processed after
    FollyCompilerMSVC.cmake.
    
    It turns out that this causes configuration to fail in confusing ways when
    compiling with clang.  CMake fails reporting that it cannot find pthread.h,
    but the real problem is just that clang does not like the `-std=gnu++14` flag
    that has been applied by FollyCompilerUnix.cmake.  CMake doesn't appear to
    have C++-only version of `CMAKE_REQUIRED_FLAGS`, so this `-std` flag was being
    used even when invoking clang in C-only mode.
    
    Moving the `find_package(Threads)` call avoids this issue.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D10435249
    
    fbshipit-source-id: 214ec9bbef43679864f714dc39c1e4423081c09b
    d949df1f
folly-deps.cmake 6.82 KB