diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe1cc73b13..9f9ebda901 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,6 +68,9 @@ jobs: run: | echo "OUTPUT=${{ env.OUTPUT }}" >> $GITHUB_ENV echo "#define FPM_BOOTSTRAP" > fpm-${{ env.VERSION }}.F90 + # Intel compiler predefines "linux" and "unix" which causes inadvertent substitutions + echo "#undef linux" >> fpm-${{ env.VERSION }}.F90 + echo "#undef unix" >> fpm-${{ env.VERSION }}.F90 fpm build --compiler ./ci/single-file-gfortran.sh env: OUTPUT: fpm-${{ env.VERSION }}.F90 diff --git a/src/fpm_compiler.f90 b/src/fpm_compiler.f90 index 5f655ac1ed..f6c02e9845 100644 --- a/src/fpm_compiler.f90 +++ b/src/fpm_compiler.f90 @@ -439,9 +439,9 @@ function get_macros(id, macros_list, version) result(macros) !> Set macro defintion symbol on the basis of compiler used select case(id) case default - macro_definition_symbol = "-D" + macro_definition_symbol = " -D" case (id_intel_classic_windows, id_intel_llvm_windows) - macro_definition_symbol = "/D" + macro_definition_symbol = " /D" end select !> Check if macros are not allocated. @@ -465,23 +465,14 @@ function get_macros(id, macros_list, version) result(macros) if (index(valued_macros(size(valued_macros)), "version") /= 0) then !> These conditions are placed in order to ensure proper spacing between the macros. - if (len(macros) == 0) then - macros = macros//macro_definition_symbol//trim(valued_macros(1))//'='//version - else - macros = macros//' '//macro_definition_symbol//trim(valued_macros(1))//'='//version - end if + macros = macros//macro_definition_symbol//trim(valued_macros(1))//'='//version cycle end if end if end if end if - !> These conditions are placed in order to ensure proper spacing between the macros. - if (len(macros) == 0) then - macros = ' '//macros//macro_definition_symbol//macros_list(i)%s - else - macros = macros//' '//macro_definition_symbol//macros_list(i)%s - end if + macros = macros//macro_definition_symbol//macros_list(i)%s end do