diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-04-24 17:36:17 +0000 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-04-24 17:36:17 +0000 |
commit | 985145ca16e4926420416e3a5f41f3e6e736c590 (patch) | |
tree | 5828b42ca49dbf656b651770714375620a720639 /tools/make_cmakelists.py | |
parent | d6e466e943f4454396a3d1f8001e927bfb740213 (diff) |
Fixed amalgamation and CMake build.
Diffstat (limited to 'tools/make_cmakelists.py')
-rwxr-xr-x | tools/make_cmakelists.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/make_cmakelists.py b/tools/make_cmakelists.py index 9a7eaf5..1fa1615 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: @@ -143,6 +152,9 @@ class BuildFileFunctions(object): def licenses(self, *args): pass + def filegroup(self, **kwargs): + pass + def map_dep(self, arg): return arg @@ -227,6 +239,7 @@ class Converter(object): endif() include_directories(.) + include_directories(generated) include_directories(${CMAKE_CURRENT_BINARY_DIR}) if(APPLE) |