This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,14 +154,6 @@ elseif(NOT VALGRIND_FOUND)
154154 message (WARNING "Valgrind not found. Valgrind tests will not be performed." )
155155endif ()
156156
157- # Find Clang
158- find_program (CLANG NAMES clang )
159- if (CLANG)
160- message (STATUS "Found clang: ${CLANG} (version: ${CLANG_VERSION} )" )
161- else ()
162- message (STATUS "clang not found" )
163- endif ()
164-
165157if (BUILD_TESTS OR BUILD_EXAMPLES OR BUILD_BENCHMARKS)
166158 # Find libpmem and libpmemobj (PMDK libraries)
167159 if (PKG_CONFIG_FOUND)
@@ -174,10 +166,9 @@ if(BUILD_TESTS OR BUILD_EXAMPLES OR BUILD_BENCHMARKS)
174166
175167 # Some tests and examples require clang >= 8.0, because of the bug
176168 # (https://bugs.llvm.org/show_bug.cgi?id=28280), which is fixed in clang v8.0.
177- set (CLANG_REQUIRED_BY_DESTRUCTOR_REFERENCE_BUG "8.0" )
178- if (CLANG)
179- get_program_version_major_minor (${CLANG} CLANG_VERSION )
180- if (CLANG_VERSION VERSION_LESS CLANG_REQUIRED_BY_DESTRUCTOR_REFERENCE_BUG)
169+
170+ if ("${CMAKE_C_COMPILER_ID} " MATCHES "Clang" AND "${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" )
171+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0" )
181172 set (CLANG_DESTRUCTOR_REFERENCE_BUG_PRESENT 1)
182173 endif ()
183174 endif ()
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ endfunction()
139139# Function to build test with atomic
140140function (build_test_atomic name )
141141 build_test (${name} ${ARGN} )
142- if (CLANG )
142+ if (" ${CMAKE_C_COMPILER_ID} " MATCHES "Clang" AND " ${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" )
143143 target_link_libraries (${name} atomic )
144144 endif ()
145145endfunction ()
You can’t perform that action at this time.
0 commit comments