[PATCH] D158846: [CMake] Fix BUILD_SHARED_LIBS build on Solaris

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 07:35:39 PDT 2023


ro updated this revision to Diff 556151.
ro added a comment.

Remove unnecessary `libm` handling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158846/new/

https://reviews.llvm.org/D158846

Files:
  llvm/lib/TargetParser/CMakeLists.txt


Index: llvm/lib/TargetParser/CMakeLists.txt
===================================================================
--- llvm/lib/TargetParser/CMakeLists.txt
+++ llvm/lib/TargetParser/CMakeLists.txt
@@ -8,6 +8,11 @@
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=global-constructors")
 endif()
 
+# Solaris code uses kstat, so specify dependency explicitly for shared builds.
+if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+  set(system_libs kstat)
+endif()
+
 add_llvm_component_library(LLVMTargetParser
   AArch64TargetParser.cpp
   ARMTargetParserCommon.cpp
@@ -25,6 +30,9 @@
   Unix
   Windows
 
+  LINK_LIBS
+  ${system_libs}
+
   LINK_COMPONENTS
   Support
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158846.556151.patch
Type: text/x-patch
Size: 660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230907/feb17481/attachment.bin>


More information about the llvm-commits mailing list