diff options
| author | Mathieu Ropert <mro@puchiko.net> | 2019-03-05 23:52:26 +0100 |
|---|---|---|
| committer | Victor Romero <romerosanchezv@gmail.com> | 2019-03-05 14:52:26 -0800 |
| commit | bf4af7afdcb5238cedbc9374e983ad8deeb31e13 (patch) | |
| tree | 810a5f040f4bdb7de5f2451c3f659eaca6adfb83 | |
| parent | 9164049386b38655aa6ce74fa4d0ec6edd9e0d80 (diff) | |
| download | vcpkg-bf4af7afdcb5238cedbc9374e983ad8deeb31e13.tar.gz vcpkg-bf4af7afdcb5238cedbc9374e983ad8deeb31e13.zip | |
Fix vcpkg build with clang on Linux (#5360)
| -rw-r--r-- | toolsrc/CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index a06cbae78..342765c1c 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -42,7 +42,18 @@ add_executable(vcpkg src/vcpkg.cpp ${VCPKGLIB_SOURCES}) target_compile_definitions(vcpkg PRIVATE -DDISABLE_METRICS=${DISABLE_METRICS_VALUE})
target_include_directories(vcpkg PRIVATE include)
-if(GCC)
+if(CLANG)
+ include(CheckCXXSourceCompiles)
+ check_cxx_source_compiles("#include <iostream>
+ int main() { return __GLIBCXX__; }" USES_LIBSTDCXX)
+ check_cxx_source_compiles("#include <iostream>
+ int main() { return _LIBCPP_VERSION; }" USES_LIBCXX)
+ if ( NOT USES_LIBSTDCXX AND NOT USES_LIBCXX )
+ message(FATAL_ERROR "Can't find which C++ runtime is in use")
+ endif()
+endif()
+
+if(GCC OR (CLANG AND USES_LIBSTDCXX))
target_link_libraries(vcpkg PRIVATE stdc++fs)
elseif(CLANG)
target_link_libraries(vcpkg PRIVATE c++experimental)
|
