summaryrefslogtreecommitdiff
path: root/tools/make_cmakelists.py
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-04-24 10:54:27 -0700
committerGitHub <noreply@github.com>2019-04-24 10:54:27 -0700
commitb08819749e6c2a6d8d771f954f6162933a8ba648 (patch)
treec80170fc566219ee865a48b3434e399b528cd01f /tools/make_cmakelists.py
parentf9dab27de3f3a77650199da487dd450a49ed35b2 (diff)
parente1fb10002d3ddda0576ab40d3a70065a27baa25a (diff)
Merge pull request #162 from haberman/aspect
Replaced upb_proto_library() with a truly aspect-based rule.
Diffstat (limited to 'tools/make_cmakelists.py')
-rwxr-xr-xtools/make_cmakelists.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/make_cmakelists.py b/tools/make_cmakelists.py
index 86544cb..e320be4 100755
--- a/tools/make_cmakelists.py
+++ b/tools/make_cmakelists.py
@@ -11,6 +11,7 @@ from __future__ import print_function
import sys
import textwrap
+import os
def StripColons(deps):
return map(lambda x: x[1:], deps)
@@ -38,12 +39,20 @@ class BuildFileFunctions(object):
if kwargs["name"] == "amalgamation" or kwargs["name"] == "upbc_generator":
return
files = kwargs.get("srcs", []) + kwargs.get("hdrs", [])
+ found_files = []
+ for file in files:
+ if os.path.isfile(file):
+ found_files.append(file)
+ elif os.path.isfile("generated/" + file):
+ found_files.append("generated/" + file)
+ else:
+ print("Warning: no such file: " + file)
if filter(IsSourceFile, files):
# Has sources, make this a normal library.
self.converter.toplevel += "add_library(%s\n %s)\n" % (
kwargs["name"],
- "\n ".join(files)
+ "\n ".join(found_files)
)
self._add_deps(kwargs)
else:
@@ -125,6 +134,9 @@ class BuildFileFunctions(object):
def upb_proto_reflection_library(self, **kwargs):
pass
+ def upb_proto_srcs(self, **kwargs):
+ pass
+
def genrule(self, **kwargs):
pass
@@ -140,6 +152,9 @@ class BuildFileFunctions(object):
def licenses(self, *args):
pass
+ def filegroup(self, **kwargs):
+ pass
+
def map_dep(self, arg):
return arg
@@ -224,6 +239,7 @@ class Converter(object):
endif()
include_directories(.)
+ include_directories(generated_for_cmake)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(APPLE)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback