This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for each header file: | |
| hash the file | |
| generate an include guard from the hash | |
| wrap the contents | |
| output into a new header file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| struct foo { | |
| int member; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct foo { | |
| int member; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef HEADER_HAS_BEEN_INCLUDED | |
| #define HEADER_HAS_BEEN_INCLUDED | |
| struct foo { | |
| int member; | |
| }; | |
| #endif | |
| #ifndef HEADER_HAS_BEEN_INCLUDED | |
| #define HEADER_HAS_BEEN_INCLUDED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "foo.hpp" | |
| #include "foo.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef HEADER_HAS_BEEN_INCLUDED | |
| #define HEADER_HAS_BEEN_INCLUDED | |
| struct foo { | |
| int member; | |
| }; | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ buck build :mathutils | |
| $ ls ./buck-out/gen/mathutils#header-mode-symlink-tree-with-header-map\,headers/mathutils/ | |
| add.hpp mathutils.hpp sub.hpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cxx_library( | |
| name = 'mathutils', | |
| header_namespace = 'mathutils', | |
| exported_headers = merge_dicts(subdir_glob([ | |
| ('mathutils/include', '**/*.hpp'), | |
| ]), { | |
| 'mathutils.hpp': ':single-header', | |
| }), | |
| srcs = glob([ | |
| 'mathutils/src/**/*.cpp', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def merge_dicts(x, y): | |
| z = x.copy() | |
| z.update(y) | |
| return z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| 'mathutils.hpp': ':single-header' | |
| } |