[WebAssembly] Fix broken build due to missing attributes.inc
authorAaron Smith <aaron.smith@microsoft.com>
Wed, 13 Jun 2018 08:38:23 +0000 (08:38 +0000)
committerAaron Smith <aaron.smith@microsoft.com>
Wed, 13 Jun 2018 08:38:23 +0000 (08:38 +0000)
WebAssembly depends on attributes.h which includes attributes.inc.
Unless cmake explicitly specifies this dependency, the .inc file
is sometimes generated after the build tries to use it.

Patch by Stella Stamenova

llvm-svn: 334581

lld/wasm/CMakeLists.txt

index 308c4e270183d981f828bbf573224e2e86a6ecef..1a9e09b38429c23e0607e9245fc8e426f3e7ea5d 100644 (file)
@@ -2,6 +2,10 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
 tablegen(LLVM Options.inc -gen-opt-parser-defs)
 add_public_tablegen_target(WasmOptionsTableGen)
 
+if(NOT LLD_BUILT_STANDALONE)
+  set(tablegen_deps intrinsics_gen)
+endif()
+
 add_lld_library(lldWasm
   Driver.cpp
   InputChunks.cpp
@@ -27,4 +31,8 @@ add_lld_library(lldWasm
 
   LINK_LIBS
   lldCommon
-  )
+
+  DEPENDS
+  WasmOptionsTableGen
+  ${tablegen_deps}
+  )
\ No newline at end of file