From c1ab3fc41cb1962db2a6909dfd07e8f088fadb8f Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Fri, 18 Feb 2022 09:54:40 -0500 Subject: Added detection of 32bit Windows and prepend -m32 flags when detected, specific to using a mingw64 multilib compiler. Moved default location to local app data. --- src/fpm_compiler.f90 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/fpm_compiler.f90') diff --git a/src/fpm_compiler.f90 b/src/fpm_compiler.f90 index d94963c..e8e97f4 100644 --- a/src/fpm_compiler.f90 +++ b/src/fpm_compiler.f90 @@ -29,6 +29,7 @@ module fpm_compiler use fpm_environment, only: & get_env, & get_os_type, & + os_is_32bit_windows, & OS_LINUX, & OS_MACOS, & OS_WINDOWS, & @@ -133,7 +134,8 @@ character(*), parameter :: & flag_gnu_warn = " -Wall -Wextra -Wimplicit-interface", & flag_gnu_check = " -fcheck=bounds -fcheck=array-temps", & flag_gnu_limit = " -fmax-errors=1", & - flag_gnu_external = " -Wimplicit-interface" + flag_gnu_external = " -Wimplicit-interface", & + flag_gnu_32bit = " -m32" character(*), parameter :: & flag_pgi_backslash = " -Mbackslash", & @@ -194,6 +196,8 @@ function get_default_flags(self, release) result(flags) end function get_default_flags subroutine get_release_compile_flags(id, flags) + implicit none + integer(compiler_enum), intent(in) :: id character(len=:), allocatable, intent(out) :: flags @@ -215,6 +219,10 @@ subroutine get_release_compile_flags(id, flags) flag_gnu_pic//& flag_gnu_limit//& flag_gnu_coarray + + if(os_is_32bit_windows()) then + flags = flag_gnu_32bit//flags + end if case(id_f95) flags = & @@ -286,6 +294,8 @@ subroutine get_release_compile_flags(id, flags) end subroutine get_release_compile_flags subroutine get_debug_compile_flags(id, flags) + implicit none + integer(compiler_enum), intent(in) :: id character(len=:), allocatable, intent(out) :: flags @@ -309,6 +319,10 @@ subroutine get_debug_compile_flags(id, flags) flag_gnu_check//& flag_gnu_backtrace//& flag_gnu_coarray + if(os_is_32bit_windows()) then + flags = flag_gnu_32bit//flags + end if + case(id_f95) flags = & flag_gnu_warn//& -- cgit v1.2.3