diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 84c3d326da..9bb4486de6 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -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)