[llvm] Fix warnings while building llvm against emscripten for web assembly (PR #118262)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 12:43:56 PST 2024


================
@@ -636,10 +636,18 @@ function(llvm_add_library name)
   endif()
 
   if(ARG_MODULE)
-    add_library(${name} MODULE ${ALL_FILES})
+    if(EMSCRIPTEN)
+      add_library(${name} STATIC ${ALL_FILES})
+    else()
+      add_library(${name} MODULE ${ALL_FILES})
+    endif()
   elseif(ARG_SHARED)
     add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
-    add_library(${name} SHARED ${ALL_FILES})
+    if(EMSCRIPTEN)
+      add_library(${name} STATIC ${ALL_FILES})
+    else()
+      add_library(${name} SHARED ${ALL_FILES})
+    endif()
----------------
sbc100 wrote:

Would it make more sense to set `ARG_SHARED` and `ARG_MODULE` to false above? 

https://github.com/llvm/llvm-project/pull/118262


More information about the llvm-commits mailing list