aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2020-07-21 23:11:28 -0600
committerOndřej Čertík <ondrej@certik.us>2020-07-21 23:11:28 -0600
commitea19382b3f9ba74456b49e8a8323a7a528227c0f (patch)
tree679435b4603af4b37b23c068db6c1aeb60dd2c1b
parent66e46f578b209eee42b9420a12550a8de0ca3e10 (diff)
downloadfpm-ea19382b3f9ba74456b49e8a8323a7a528227c0f.tar.gz
fpm-ea19382b3f9ba74456b49e8a8323a7a528227c0f.zip
Implement get_os()
-rw-r--r--fpm/src/fpm.f9017
1 files changed, 17 insertions, 0 deletions
diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90
index 85597c0..d9d1bac 100644
--- a/fpm/src/fpm.f90
+++ b/fpm/src/fpm.f90
@@ -3,8 +3,25 @@ implicit none
private
public :: print_help, cmd_build
+integer, parameter :: os_linux = 1
+integer, parameter :: os_macos = 2
+integer, parameter :: os_windows = 3
+
contains
+integer function get_os() result(r)
+#ifdef _WIN32
+ r = os_windows
+#elif defined __APPLE__
+ r = os_macos
+#elif defined __linux__
+ r = os_linux
+#else
+ ! Unsupported platform
+ error stop
+#endif
+end function
+
subroutine print_help()
print *, "Fortran Package Manager (fpm)"
end subroutine