Skip to content

Commit

Permalink
only enable link what you use on GNU compilers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
njzjz committed Apr 20, 2021
1 parent b3ebfc1 commit ee8c419
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(DeePMD)
set(CMAKE_LINK_WHAT_YOU_USE TRUE)
if (CMAKE_COMPILER_IS_GNU)
set(CMAKE_LINK_WHAT_YOU_USE TRUE)
endif ()

# build cpp or python interfaces
if (NOT DEFINED BUILD_CPP_IF)
Expand Down

0 comments on commit ee8c419

Please sign in to comment.