Skip to content

Commit e781a77

Browse files
authored
Merge pull request #804 from urbanjost/main
2 parents 58c7f76 + b0bcf31 commit e781a77

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ jobs:
6868
run: |
6969
echo "OUTPUT=${{ env.OUTPUT }}" >> $GITHUB_ENV
7070
echo "#define FPM_BOOTSTRAP" > fpm-${{ env.VERSION }}.F90
71+
# Intel compiler predefines "linux" and "unix" which causes inadvertent substitutions
72+
echo "#undef linux" >> fpm-${{ env.VERSION }}.F90
73+
echo "#undef unix" >> fpm-${{ env.VERSION }}.F90
7174
fpm build --compiler ./ci/single-file-gfortran.sh
7275
env:
7376
OUTPUT: fpm-${{ env.VERSION }}.F90

src/fpm_compiler.f90

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ function get_macros(id, macros_list, version) result(macros)
439439
!> Set macro defintion symbol on the basis of compiler used
440440
select case(id)
441441
case default
442-
macro_definition_symbol = "-D"
442+
macro_definition_symbol = " -D"
443443
case (id_intel_classic_windows, id_intel_llvm_windows)
444-
macro_definition_symbol = "/D"
444+
macro_definition_symbol = " /D"
445445
end select
446446

447447
!> Check if macros are not allocated.
@@ -465,23 +465,14 @@ function get_macros(id, macros_list, version) result(macros)
465465
if (index(valued_macros(size(valued_macros)), "version") /= 0) then
466466

467467
!> These conditions are placed in order to ensure proper spacing between the macros.
468-
if (len(macros) == 0) then
469-
macros = macros//macro_definition_symbol//trim(valued_macros(1))//'='//version
470-
else
471-
macros = macros//' '//macro_definition_symbol//trim(valued_macros(1))//'='//version
472-
end if
468+
macros = macros//macro_definition_symbol//trim(valued_macros(1))//'='//version
473469
cycle
474470
end if
475471
end if
476472
end if
477473
end if
478474

479-
!> These conditions are placed in order to ensure proper spacing between the macros.
480-
if (len(macros) == 0) then
481-
macros = ' '//macros//macro_definition_symbol//macros_list(i)%s
482-
else
483-
macros = macros//' '//macro_definition_symbol//macros_list(i)%s
484-
end if
475+
macros = macros//macro_definition_symbol//macros_list(i)%s
485476

486477
end do
487478

0 commit comments

Comments
 (0)