Skip to content

Commit ee8c419

Browse files
committed
only enable link what you use on GNU compilers
Clang doesn't support this flag, cause an error on osx: > ld: unknown option: --no-as-needed This commit should be cherry-picked to `r1.2` branch.
1 parent b3ebfc1 commit ee8c419

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 3.7)
22
project(DeePMD)
3-
set(CMAKE_LINK_WHAT_YOU_USE TRUE)
3+
if (CMAKE_COMPILER_IS_GNU)
4+
set(CMAKE_LINK_WHAT_YOU_USE TRUE)
5+
endif ()
46

57
# build cpp or python interfaces
68
if (NOT DEFINED BUILD_CPP_IF)

0 commit comments

Comments
 (0)