{"action":"created","issue":{"url":"https://api.github.com/repos/atilaneves/reggae/issues/13","labels_url":"https://api.github.com/repos/atilaneves/reggae/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/atilaneves/reggae/issues/13/comments","events_url":"https://api.github.com/repos/atilaneves/reggae/issues/13/events","html_url":"https://github.com/atilaneves/reggae/issues/13","id":98861026,"number":13,"title":"Same target built multiple times","user":{"login":"yshui","id":366851,"avatar_url":"https://avatars.githubusercontent.com/u/366851?v=3","gravatar_id":"","url":"https://api.github.com/users/yshui","html_url":"https://github.com/yshui","followers_url":"https://api.github.com/users/yshui/followers","following_url":"https://api.github.com/users/yshui/following{/other_user}","gists_url":"https://api.github.com/users/yshui/gists{/gist_id}","starred_url":"https://api.github.com/users/yshui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yshui/subscriptions","organizations_url":"https://api.github.com/users/yshui/orgs","repos_url":"https://api.github.com/users/yshui/repos","events_url":"https://api.github.com/users/yshui/events{/privacy}","received_events_url":"https://api.github.com/users/yshui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-03T23:57:45Z","updated_at":"2015-08-04T08:13:32Z","closed_at":null,"body":"Simple example:\r\n\r\n```d\r\nimport reggae;\r\n\r\nconst ao = objectFile(SourceFile(\"a.c\"));\r\nconst bo = objectFile(SourceFile(\"b.c\"));\r\nconst co = objectFile(SourceFile(\"c.c\"));\r\nconst t1 = Target(\"b\", \"gcc -o$out $in\", [ao, bo]);\r\nconst t2 = Target(\"c\", \"gcc -o$out $in\", [ao, co]);\r\nmixin build!(t1, t2);\r\n```\r\n\r\na.c will be compiled twice, which is unnecessary."},"comment":{"url":"https://api.github.com/repos/atilaneves/reggae/issues/comments/127516479","html_url":"https://github.com/atilaneves/reggae/issues/13#issuecomment-127516479","issue_url":"https://api.github.com/repos/atilaneves/reggae/issues/13","id":127516479,"user":{"login":"atilaneves","id":4956425,"avatar_url":"https://avatars.githubusercontent.com/u/4956425?v=3","gravatar_id":"","url":"https://api.github.com/users/atilaneves","html_url":"https://github.com/atilaneves","followers_url":"https://api.github.com/users/atilaneves/followers","following_url":"https://api.github.com/users/atilaneves/following{/other_user}","gists_url":"https://api.github.com/users/atilaneves/gists{/gist_id}","starred_url":"https://api.github.com/users/atilaneves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atilaneves/subscriptions","organizations_url":"https://api.github.com/users/atilaneves/orgs","repos_url":"https://api.github.com/users/atilaneves/repos","events_url":"https://api.github.com/users/atilaneves/events{/privacy}","received_events_url":"https://api.github.com/users/atilaneves/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T08:13:32Z","updated_at":"2015-08-04T08:13:32Z","body":"CMake would do the same thing. If you want to use the same source file with the same flags for two different binaries, use a static library. Unfortunately a convenience function for that is currently on my TODO list, so you'd have to specify the commands manually. Just make sure the lib is in the build directory by starting its output name with `$builddir`."}}