Lines Matching refs:target

47   """Escapes the string 'a' for use as a CMake target name.
49 CMP0037 in CMake 3.0 restricts target names to "^[A-Za-z0-9_.:+-]+$"
96 """Given a target, sets the given property."""
97 out.write('set_target_properties("${target}" PROPERTIES ')
234 def WriteAction(out, target, project, sources, synthetic_dependencies):
237 for output in target.properties.get('outputs', []):
243 outputs_name = '${target}__output'
255 script = target.properties['script']
256 arguments = target.properties['args']
277 out.write(' COMMENT "Action: ${target}"\n')
295 def WriteActionForEach(out, target, project, sources, synthetic_dependencies):
296 all_outputs = target.properties.get('outputs', [])
297 inputs = target.properties.get('sources', [])
312 outputs_name = '${target}__output_' + str(count)
324 script = target.properties['script']
326 arguments = target.properties['args']
350 out.write(' COMMENT "Action ${target} on ')
359 def WriteCopy(out, target, project, sources, synthetic_dependencies):
360 inputs = target.properties.get('sources', [])
361 raw_outputs = target.properties.get('outputs', [])
368 outputs_name = '${target}__output'
398 out.write(' COMMENT "Copy ${target}"\n')
405 def WriteCompilerFlags(out, target, project, sources):
424 includes = target.properties.get('include_dirs', [])
426 out.write('set_property(TARGET "${target}" ')
435 defines = target.properties.get('defines', [])
442 # CMake does not have per target lang compile flags.
446 flags.extend(target.properties.get('cflags', []))
447 cflags_asm = target.properties.get('asmflags', [])
448 cflags_c = target.properties.get('cflags_c', [])
449 cflags_cxx = target.properties.get('cflags_cc', [])
451 cflags_objc.extend(target.properties.get('cflags_objc', []))
453 cflags_objcc.extend(target.properties.get('cflags_objcc', []))
480 ldflags = target.properties.get('ldflags', [])
493 def WriteSourceVariables(out, target, project):
499 all_sources = target.properties.get('sources', [])
512 for input_path in target.properties.get('inputs', []):
519 if target.gn_type in gn_target_types_that_absorb_objects:
521 project.GetObjectSourceDependencies(target.gn_name, object_dependencies)
530 sources[source_type] = '${target}__' + source_type + '_srcs'
535 def WriteTarget(out, target, project):
537 out.write(target.gn_name)
540 if target.cmake_type is None:
541 print ('Target %s has unknown target type %s, skipping.' %
542 ( target.gn_name, target.gn_type ) )
545 SetVariable(out, 'target', target.cmake_name)
547 sources = WriteSourceVariables(out, target, project)
550 if target.gn_type == 'action':
551 WriteAction(out, target, project, sources, synthetic_dependencies)
552 if target.gn_type == 'action_foreach':
553 WriteActionForEach(out, target, project, sources, synthetic_dependencies)
554 if target.gn_type == 'copy':
555 WriteCopy(out, target, project, sources, synthetic_dependencies)
557 out.write(target.cmake_type.command)
558 out.write('("${target}"')
559 if target.cmake_type.modifier is not None:
561 out.write(target.cmake_type.modifier)
570 if target.cmake_type.command != 'add_custom_target':
571 WriteCompilerFlags(out, target, project, sources)
576 dependencies = set(target.properties.get('deps', []))
581 if target.gn_type != 'source_set':
582 project.GetObjectLibraryDependencies(target.gn_name, object_dependencies)
593 if target.cmake_type.is_linkable:
600 out.write('add_dependencies("${target}"')
608 combined_library_lists = [target.properties.get(key, []) for key in ['libs', 'frameworks']]
610 if target.cmake_type.is_linkable and (external_libraries or libraries):
611 library_dirs = target.properties.get('lib_dirs', [])
613 SetVariableList(out, '${target}__library_directories', library_dirs)
624 system_library = system_library + '__for_${target}'
632 WriteVariable(out, '${target}__library_directories')
636 out.write('target_link_libraries("${target}"')
692 # The gn generated build.ninja target uses build.ninja.d