Skip to content

Commit e7f949b

Browse files
committed
Adding PlatformUtils
1 parent c792f32 commit e7f949b

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Libs/Utils/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ set(Utils_sources
33
Utils.cpp
44
StringUtils.cpp
55
EigenUtils.cpp
6+
PlatformUtils.cpp
67
)
78

89
set(Utils_headers
910
Utils.h
1011
StringUtils.h
1112
EigenUtils.h
13+
PlatformUtils.h
1214
)
1315

1416
add_library(Utils STATIC

Libs/Utils/PlatformUtils.cpp

Whitespace-only changes.

Libs/Utils/PlatformUtils.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
namespace shapeworks {
3+
4+
//! Platform utility functions
5+
class PlatformUtils {
6+
public:
7+
static bool is_windows() {
8+
#ifdef _WIN32
9+
return true;
10+
#endif
11+
return false;
12+
}
13+
14+
static bool is_linux() {
15+
#ifdef __linux__
16+
return true;
17+
#endif
18+
return false;
19+
}
20+
21+
static bool is_macos() {
22+
#ifdef __APPLE__
23+
return true;
24+
#endif
25+
return false;
26+
}
27+
};
28+
29+
} // namespace shapeworks

0 commit comments

Comments
 (0)