diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-07-21 23:11:28 -0600 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-07-21 23:11:28 -0600 |
commit | ea19382b3f9ba74456b49e8a8323a7a528227c0f (patch) | |
tree | 679435b4603af4b37b23c068db6c1aeb60dd2c1b | |
parent | 66e46f578b209eee42b9420a12550a8de0ca3e10 (diff) | |
download | fpm-ea19382b3f9ba74456b49e8a8323a7a528227c0f.tar.gz fpm-ea19382b3f9ba74456b49e8a8323a7a528227c0f.zip |
Implement get_os()
-rw-r--r-- | fpm/src/fpm.f90 | 17 |
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 |