8000 fixes #803 and #772 by urbanjost · Pull Request #804 · fortran-lang/fpm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fixes #803 and #772 #804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 4 additions & 13 deletions src/fpm_compiler.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
0