Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
9ffb8df6
Commit
9ffb8df6
authored
Oct 05, 2018
by
Gregorio Litenstein
Committed by
Dominic Hamon
Oct 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Clang Detection (#697)
For several versions now, CMake by default refers to macOS’ Clang as AppleClang instead of just Clang, which would fail STREQUAL. Fixed by changing it to MATCHES.
parent
a8082de5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
CMakeLists.txt
CMakeLists.txt
+2
-2
HandleGTest.cmake
cmake/HandleGTest.cmake
+1
-1
No files found.
CMakeLists.txt
View file @
9ffb8df6
...
@@ -193,7 +193,7 @@ else()
...
@@ -193,7 +193,7 @@ else()
if
(
GCC_RANLIB
)
if
(
GCC_RANLIB
)
set
(
CMAKE_RANLIB
${
GCC_RANLIB
}
)
set
(
CMAKE_RANLIB
${
GCC_RANLIB
}
)
endif
()
endif
()
elseif
(
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"Clang"
)
elseif
(
"
${
CMAKE_C_COMPILER_ID
}
"
MATCHES
"Clang"
)
include
(
llvm-toolchain
)
include
(
llvm-toolchain
)
endif
()
endif
()
endif
()
endif
()
...
@@ -218,7 +218,7 @@ else()
...
@@ -218,7 +218,7 @@ else()
endif
()
endif
()
if
(
BENCHMARK_USE_LIBCXX
)
if
(
BENCHMARK_USE_LIBCXX
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
add_cxx_compiler_flag
(
-stdlib=libc++
)
add_cxx_compiler_flag
(
-stdlib=libc++
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
OR
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Intel"
)
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Intel"
)
...
...
cmake/HandleGTest.cmake
View file @
9ffb8df6
...
@@ -5,7 +5,7 @@ macro(build_external_gtest)
...
@@ -5,7 +5,7 @@ macro(build_external_gtest)
include
(
ExternalProject
)
include
(
ExternalProject
)
set
(
GTEST_FLAGS
""
)
set
(
GTEST_FLAGS
""
)
if
(
BENCHMARK_USE_LIBCXX
)
if
(
BENCHMARK_USE_LIBCXX
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
list
(
APPEND GTEST_FLAGS -stdlib=libc++
)
list
(
APPEND GTEST_FLAGS -stdlib=libc++
)
else
()
else
()
message
(
WARNING
"Unsupported compiler (
${
CMAKE_CXX_COMPILER
}
) when using libc++"
)
message
(
WARNING
"Unsupported compiler (
${
CMAKE_CXX_COMPILER
}
) when using libc++"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment