{"action":"opened","issue":{"url":"https://api.github.com/repos/fawkesrobotics/fawkes/issues/37","repository_url":"https://api.github.com/repos/fawkesrobotics/fawkes","labels_url":"https://api.github.com/repos/fawkesrobotics/fawkes/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/fawkesrobotics/fawkes/issues/37/comments","events_url":"https://api.github.com/repos/fawkesrobotics/fawkes/issues/37/events","html_url":"https://github.com/fawkesrobotics/fawkes/issues/37","id":388166550,"node_id":"MDU6SXNzdWUzODgxNjY1NTA=","number":37,"title":"Locally build gtest from external sources","user":{"login":"morxa","id":4573064,"node_id":"MDQ6VXNlcjQ1NzMwNjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4573064?v=4","gravatar_id":"","url":"https://api.github.com/users/morxa","html_url":"https://github.com/morxa","followers_url":"https://api.github.com/users/morxa/followers","following_url":"https://api.github.com/users/morxa/following{/other_user}","gists_url":"https://api.github.com/users/morxa/gists{/gist_id}","starred_url":"https://api.github.com/users/morxa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morxa/subscriptions","organizations_url":"https://api.github.com/users/morxa/orgs","repos_url":"https://api.github.com/users/morxa/repos","events_url":"https://api.github.com/users/morxa/events{/privacy}","received_events_url":"https://api.github.com/users/morxa/received_events","type":"User","site_admin":false},"labels":[{"id":1152477286,"node_id":"MDU6TGFiZWwxMTUyNDc3Mjg2","url":"https://api.github.com/repos/fawkesrobotics/fawkes/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-06T11:14:00Z","updated_at":"2018-12-06T11:14:00Z","closed_at":null,"author_association":"MEMBER","body":"I'm trying to enable tests on both Fedora and Ubuntu builds. While Fedora builds googletest as a shared library, Ubuntu only ships the sources, because gtest is mainly intended as a copylib. I'd like to build those sources locally and use that library. I'm seeing three options:\r\n1. Provide a special recipe for gtest, something like:\r\n    ``` Makefile\r\n    $(LIBDIR)/test/libgtest.so: $(GTEST_SRCDIR)/gtest-all.cc\r\n    \t$(CC) $(CFLAGS) -c $(GTEST_SRCDIR)/gtest-all.cc -o gtest-all.o\r\n    \t$(CC) $(LDFLAGS) -o $(LIBDIR)/test/libgtest.so gtest-all.o $(addprefix -l,$(LIBS_libgtest))\r\n    \r\n    test: $(LIBDIR)/test/libgtest.so\r\n    ```\r\n    The disadvantage: We're not making use of any of the generic rules (e.g., `%.o: %.cpp`), so it's not very integrated into the build system.\r\n1. Build gtest in the same way as any other library. However, this currently does not work, because it would create the object files in `$(GTEST_SRCDIR)` which may be read-only (e.g., because it's in `/usr/src/googletest`). So this would need some adaption of the build system. This may be hard though, because the object files need to be in a different location than the src files, so any rule of the form `%o: %.cpp` will not work.\r\n1. Copy the sources into the local directory and then build as a normal library. The disadvantage is of course that we copy all the source files into the local tree. The advantage of this option: If there is no source anywhere on the system, we could fetch the source from upstream and then build it in the same way.\r\n\r\nSo I'm not sure what the best option is, or if there is a better way to do this. What do you think?"}}
{"actor":{"display_login":"morxa"}}