summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Leidel <john.leidel@ttu.edu>2015-05-07 09:29:04 -0500
committerCraig Griffiths <craig.griffiths@codethink.co.uk>2015-08-14 10:21:11 +0100
commitbd5cc9c68333bc6fd42c4c14bdcf7d4f4c5f31ea (patch)
tree22ba8600e9bfec27aadfeb796902efb55627b216
parentc80c30db9a931fa8b49f31b6bbbe381b510dffa2 (diff)
downloadflang-bd5cc9c68333bc6fd42c4c14bdcf7d4f4c5f31ea.tar.gz
fixing build dependency for TableGen files; Now forces all Flang libs to depend upon the TableGen *.inc files (similar to Clang); Fix for Issue #5
-rw-r--r--CMakeLists.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5dae9b201d..79607a2c40 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -242,19 +242,19 @@ function(flang_tablegen)
# executing the custom command depending on output-file. It is
# possible to list more files to depend after DEPENDS.
- parse_arguments( CTG "SOURCE;TARGET;DEPENDS" "" ${ARGN} )
+ cmake_parse_arguments(CTG "" "SOURCE;TARGET" "" ${ARGN})
if( NOT CTG_SOURCE )
message(FATAL_ERROR "SOURCE source-file required by flang_tablegen")
endif()
set( LLVM_TARGET_DEFINITIONS ${CTG_SOURCE} )
- tablegen( FLANG ${CTG_DEFAULT_ARGS} )
+ tablegen(FLANG ${CTG_UNPARSED_ARGUMENTS})
- list( GET CTG_DEFAULT_ARGS 0 output_file )
- if( CTG_TARGET )
- add_custom_target( ${CTG_TARGET} DEPENDS ${output_file} ${CTG_DEPENDS} )
+ if(CTG_TARGET)
+ add_public_tablegen_target(${CTG_TARGET})
set_target_properties( ${CTG_TARGET} PROPERTIES FOLDER "Flang tablegenning")
+ set_property(GLOBAL APPEND PROPERTY FLANG_TABLEGEN_TARGETS ${CTG_TARGET})
endif()
endfunction(flang_tablegen)
@@ -346,6 +346,11 @@ mark_as_advanced(FLANG_EXECUTABLE_VERSION LIBFLANG_LIBRARY_VERSION)
add_subdirectory(utils/TableGen)
add_subdirectory(include)
+
+# All targets below may depend on all tablegen'd files
+get_property(FLANG_TABLEGEN_TARGETS GLOBAL PROPERTY FLANG_TABLEGEN_TARGETS)
+list(APPEND LLVM_COMMON_DEPENDS ${FLANG_TABLEGEN_TARGETS})
+
add_subdirectory(lib)
add_subdirectory(tools)
add_subdirectory(test)