message: Change definion of static linking
diff: @@ -115,9 +115,9 @@ endif()
  if (UNIX)
  option(ISPC_STATIC_STDCXX_LINK "Link statically with libstdc++ and libgcc" OFF)
  if (ISPC_PREPARE_PACKAGE AND (NOT APPLE))
  - option(ISPC_STATIC_LINK "Link statically" ON)
  + option(ISPC_STATIC_LINK "Link statically (all except glibc)" ON)
  else()
  - option(ISPC_STATIC_LINK "Link statically" OFF)
  + option(ISPC_STATIC_LINK "Link statically (all except glibc)" OFF)
  endif()
  option(ISPC_USE_ASAN "Build ispc with address sanitizer instrumentation using clang compiler" OFF)
  endif()
  @@ -370,14 +370,10 @@ else()
  set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-z noexecstack -z relro -z now -Wl,--gc-sections")
  endif()
  -if (ISPC_STATIC_STDCXX_LINK)
  +if (ISPC_STATIC_STDCXX_LINK OR ISPC_STATIC_LINK)
  set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
  endif()
  -if (ISPC_STATIC_LINK)
  - set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-static")
  -endif()
  -
  if (ISPC_USE_ASAN)
  set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fsanitize=address")
  endif()
  @@ -391,16 +387,19 @@ target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
  # Link against LLVM libraries
  target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST})
  +
  +# System libraries, our own and transitive dependencies from LLVM libs.
  if (WIN32)
  target_link_libraries(${PROJECT_NAME} version.lib shlwapi.lib odbc32.lib odbccp32.lib)
  else()
  - target_link_libraries(${PROJECT_NAME} pthread dl)
  - target_link_libraries(${PROJECT_NAME} z)
  if (APPLE)
  - target_link_libraries(${PROJECT_NAME} curses)
  + target_link_libraries(${PROJECT_NAME} pthread z curses)
  else()
  - target_link_libraries(${PROJECT_NAME} tinfo)
  - target_link_libraries(${PROJECT_NAME} curses)
  + if (ISPC_STATIC_LINK)
  + target_link_libraries(${PROJECT_NAME} pthread z.a tinfo.a curses.a)
  + else()
  + target_link_libraries(${PROJECT_NAME} pthread z tinfo curses)
  + endif()
  endif()
  endif()
  