diff options
Diffstat (limited to 'libadhocutil/definedDirs.h')
-rw-r--r-- | libadhocutil/definedDirs.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libadhocutil/definedDirs.h b/libadhocutil/definedDirs.h index d746891..1768bba 100644 --- a/libadhocutil/definedDirs.h +++ b/libadhocutil/definedDirs.h @@ -1,16 +1,13 @@ -#ifndef ADHOCUTIL_DEFINEDDIRS_H -#define ADHOCUTIL_DEFINEDDIRS_H +#pragma once #include <filesystem> -#ifndef ROOT -# error "ROOT needs to be defined at compilation time" -#endif - -#define XSTR(s) STR(s) -#define STR(s) #s -const std::filesystem::path selfExe = std::filesystem::canonical("/proc/self/exe"); -const std::filesystem::path binDir = selfExe.parent_path(); -const std::filesystem::path rootDir(XSTR(ROOT)); - +inline const std::filesystem::path selfExe = std::filesystem::canonical("/proc/self/exe"); +inline const std::filesystem::path binDir = selfExe.parent_path(); +#ifdef ROOT +# define XSTR(s) STR(s) +# define STR(s) # s +inline const std::filesystem::path rootDir(XSTR(ROOT)); +# undef XSTR +# undef STR #endif |