We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 87a2cbf + 5651c74 commit 2ba3478Copy full SHA for 2ba3478
src/fpm.f90
@@ -4,12 +4,13 @@ module fpm
4
use fpm_command_line, only: fpm_build_settings, fpm_new_settings, &
5
fpm_run_settings, fpm_install_settings, fpm_test_settings
6
use fpm_dependency, only : new_dependency_tree
7
-use fpm_environment, only: run, get_env, get_archiver
+use fpm_environment, only: run, get_env
8
use fpm_filesystem, only: is_dir, join_path, number_of_rows, list_files, exists, basename
9
use fpm_model, only: fpm_model_t, srcfile_t, show_model, &
10
FPM_SCOPE_UNKNOWN, FPM_SCOPE_LIB, FPM_SCOPE_DEP, &
11
FPM_SCOPE_APP, FPM_SCOPE_EXAMPLE, FPM_SCOPE_TEST
12
-use fpm_compiler, only: get_module_flags, is_unknown_compiler, get_default_c_compiler
+use fpm_compiler, only: get_module_flags, is_unknown_compiler, get_default_c_compiler, &
13
+ get_archiver
14
15
16
use fpm_sources, only: add_executable_sources, add_sources_from_dir
src/fpm_compiler.f90
@@ -27,7 +27,7 @@
27
! Unisys ? ? ? ? ? discontinued
28
module fpm_compiler
29
use fpm_model, only: fpm_model_t
30
-use fpm_filesystem, only: join_path, basename
+use fpm_filesystem, only: join_path, basename, get_temp_filename
31
use fpm_environment, only: &
32
get_os_type, &
33
OS_LINUX, &
@@ -36,13 +36,15 @@ module fpm_compiler
36
OS_CYGWIN, &
37
OS_SOLARIS, &
38
OS_FREEBSD, &
39
- OS_OPENBSD
+ OS_OPENBSD, &
40
+ OS_UNKNOWN
41
implicit none
42
public :: is_unknown_compiler
43
public :: get_module_flags
44
public :: get_default_compile_flags
45
public :: get_debug_compile_flags
46
public :: get_release_compile_flags
47
+public :: get_archiver
48
49
enum, bind(C)
50
enumerator :: &
@@ -464,4 +466,23 @@ function is_unknown_compiler(compiler) result(is_unknown)
464
466
is_unknown = get_compiler_id(compiler) == id_unknown
465
467
end function is_unknown_compiler
468
469
+
470
+function get_archiver() result(archiver)
471
+ character(:), allocatable :: archiver
472
+ integer :: estat, os_type
473
474
+ os_type = get_os_type()
475
+ if (os_type /= OS_WINDOWS .and. os_type /= OS_UNKNOWN) then
476
+ archiver = "ar -rs "
477
+ else
478
+ call execute_command_line("ar --version > "//get_temp_filename()//" 2>&1", &
479
+ & exitstat=estat)
480
+ if (estat /= 0) then
481
+ archiver = "lib /OUT:"
482
483
484
+ end if
485
486
+end function
487
488
end module fpm_compiler
src/fpm_environment.f90
@@ -12,7 +12,6 @@ module fpm_environment
public :: os_is_unix
public :: run
public :: get_env
- public :: get_archiver
public :: get_command_arguments_quoted
17
public :: separator
18
@@ -195,26 +194,6 @@ function get_env(NAME,DEFAULT) result(VALUE)
195
194
if(VALUE.eq.''.and.present(DEFAULT))VALUE=DEFAULT
196
end function get_env
197
198
- function get_archiver() result(archiver)
199
- character(:), allocatable :: archiver
200
-
201
- associate(os_type => get_os_type())
202
- if (os_type /= OS_WINDOWS .and. os_type /= OS_UNKNOWN) then
203
- archiver = "ar -rs "
204
- else
205
- block
206
- integer :: estat
207
208
- call execute_command_line("ar --version", exitstat=estat)
209
- if (estat /= 0) then
210
- archiver = "lib /OUT:"
211
212
213
- end if
214
- end block
215
216
- end associate
217
- end function
218
function get_command_arguments_quoted() result(args)
219
character(len=:),allocatable :: args
220
character(len=:),allocatable :: arg
0 commit comments