From d54f6ba7b8383783580abad2e27dd27f78c2902e Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 26 Jun 2013 18:20:05 +0000 Subject: [PATCH] Allow targets to override generic implementations Targets can override generic implementations by adding a file called OVERRIDES in $(TARGET_DIR)/lib and listing the generic implementations that it wants to override. For example, to override get_group_id() and get_global_size() you would add these lines to the OVERRIDES file: workitem/get_group_id.cl workitem/get_global_size.cl llvm-svn: 184982 --- libclc/configure.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libclc/configure.py b/libclc/configure.py index a35537aa3f8d..ec443ad3bce8 100755 --- a/libclc/configure.py +++ b/libclc/configure.py @@ -142,6 +142,14 @@ for target in targets: for libdir in libdirs: subdir_list_file = os.path.join(libdir, 'SOURCES') manifest_deps.add(subdir_list_file) + override_list_file = os.path.join(libdir, 'OVERRIDES') + + # Add target overrides + if os.path.exists(override_list_file): + for override in open(override_list_file).readlines(): + override = override.rstrip() + sources_seen.add(override) + for src in open(subdir_list_file).readlines(): src = src.rstrip() if src not in sources_seen: