cmake覆盖内置值

时间:2018-10-03 23:24:42

标签: cmake cmake-modules cmake-language

我试图弄清楚为什么此代码在CMmake <= 3.9.6上有效,而在cmake 3.12.1上无效

我认为此宏中有一个错误

macro(add_library name)
  llvm_process_sources(srcs ${AN})
  if (MODULE)
    set(libkind MODULE)
  elseif (SHARED_LIBRARY)
    set(libkind SHARED)
  else()
    set(libkind)
  endif()
  add_library( ${name} ${libkind} ${srcs} )
  llvm_update_compile_flags(${name} ${srcs})
  if( LLVM_COMMON_DEPENDS )
    add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
  endif( LLVM_COMMON_DEPENDS )

  llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
  target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
#  link_system_libs( ${name} )  # getd of cmake warning messages

  install(TARGETS ${name}
    LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
    RUNTIME DESTINATION bin)
  set_target_properties(${name} PROPERTIES FOLDER "Project libraries")
endmacro(add_library)

是否有一个通用的修复程序,或者我需要编写此宏的多个版本?

0 个答案:

没有答案