Add ODIN_BUILD_PROJECT_NAME and //+build-project-name

This allows for condition inclusion of files, similar to `+build` or `ODIN_BUILD`, but relies on the directory name of the project to be the same as specified

Example:

    odin build foo/bar/baz

    ODIN_BUILD_PROJECT_NAME == "baz"

    //+build_project_name baz
This commit is contained in:
gingerBill
2022-09-08 16:35:25 +01:00
parent 39728b8bfb
commit 81e3b64ecd
3 changed files with 58 additions and 1 deletions
+1
View File
@@ -938,6 +938,7 @@ void init_universal(void) {
add_global_string_constant("ODIN_VENDOR", bc->ODIN_VENDOR);
add_global_string_constant("ODIN_VERSION", bc->ODIN_VERSION);
add_global_string_constant("ODIN_ROOT", bc->ODIN_ROOT);
add_global_string_constant("ODIN_BUILD_PROJECT_NAME", bc->ODIN_BUILD_PROJECT_NAME);
{
GlobalEnumValue values[TargetOs_COUNT] = {