llvm.org GIT mirror llvm / a042c23
Fix build with CMake if LLVM_USE_INTEL_JITEVENTS option is enabled * Added LLVM libraries required for IntelJITEvents to LLVMBuild.txt. * Removed 'jit' library from llvm-jitlistener. * Added support for OptionalLibraries to llvm-build cmake files generator. Patch by aleksey.a.bader@intel.com Differential Revision: http://reviews.llvm.org/D5646 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220848 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Kuperstein 6 years ago
3 changed file(s) with 24 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
2020 type = OptionalLibrary
2121 name = IntelJITEvents
2222 parent = ExecutionEngine
23 required_libraries = Core DebugInfo Support
99 inteljitevents
1010 interpreter
1111 irreader
12 jit
1312 mcjit
1413 nativecodegen
1514 object
4040 """
4141 mk_quote_string_for_target(target_name) -> str
4242
43 Return a quoted form of the given target_name suitable for including in a
43 Return a quoted form of the given target_name suitable for including in a
4444 Makefile as a target name.
4545 """
4646
339339 # Compute the llvm-config "component name". For historical reasons,
340340 # this is lowercased based on the library name.
341341 llvmconfig_component_name = c.get_llvmconfig_component_name()
342
342
343343 # Get the library name, or None for LibraryGroups.
344344 if c.type_name == 'Library' or c.type_name == 'OptionalLibrary':
345345 library_name = c.get_prefixed_library_name()
429429 traversed to include their required libraries.
430430 """
431431
432 assert ci.type_name in ('Library', 'LibraryGroup', 'TargetGroup')
432 assert ci.type_name in ('Library', 'OptionalLibrary', 'LibraryGroup', 'TargetGroup')
433433
434434 for name in ci.required_libraries:
435435 # Get the dependency info.
436436 dep = self.component_info_map[name]
437437
438438 # If it is a library, yield it.
439 if dep.type_name == 'Library':
439 if dep.type_name == 'Library' or dep.type_name == 'OptionalLibrary':
440440 yield dep
441441 continue
442442
491491 if (path.startswith(self.source_root) and os.path.exists(path)):
492492 yield path
493493
494 def write_cmake_fragment(self, output_path):
494 def write_cmake_fragment(self, output_path, enabled_optional_components):
495495 """
496496 write_cmake_fragment(output_path) -> None
497497
560560 # names to required libraries, in a way that is easily accessed from CMake.
561561 """)
562562 for ci in self.ordered_component_infos:
563 # We only write the information for libraries currently.
564 if ci.type_name != 'Library':
563 # Skip optional components which are not enabled.
564 if ci.type_name == 'OptionalLibrary' \
565 and ci.name not in enabled_optional_components:
566 continue
567
568 # We only write the information for certain components currently.
569 if ci.type_name not in ('Library', 'OptionalLibrary'):
565570 continue
566571
567572 f.write("""\
572577
573578 f.close()
574579
575 def write_cmake_exports_fragment(self, output_path):
580 def write_cmake_exports_fragment(self, output_path, enabled_optional_components):
576581 """
577582 write_cmake_exports_fragment(output_path) -> None
578583
594599 # dependencies of libraries imported from LLVM.
595600 """)
596601 for ci in self.ordered_component_infos:
602 # Skip optional components which are not enabled.
603 if ci.type_name == 'OptionalLibrary' \
604 and ci.name not in enabled_optional_components:
605 continue
606
597607 # We only write the information for libraries currently.
598 if ci.type_name != 'Library':
608 if ci.type_name not in ('Library', 'OptionalLibrary'):
599609 continue
600610
601611 # Skip disabled targets.
904914
905915 # Write out the cmake fragment, if requested.
906916 if opts.write_cmake_fragment:
907 project_info.write_cmake_fragment(opts.write_cmake_fragment)
917 project_info.write_cmake_fragment(opts.write_cmake_fragment,
918 opts.optional_components)
908919 if opts.write_cmake_exports_fragment:
909 project_info.write_cmake_exports_fragment(opts.write_cmake_exports_fragment)
920 project_info.write_cmake_exports_fragment(opts.write_cmake_exports_fragment,
921 opts.optional_components)
910922
911923 # Configure target definition files, if requested.
912924 if opts.configure_target_def_files: