Skip to content
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

Update compile/link args in config/meson.build #31

Merged
merged 1 commit into from
Nov 20, 2023
Merged
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
43 changes: 22 additions & 21 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,44 @@
# limitations under the License.

os = host_machine.system()

if os == 'windows'
add_project_link_arguments(
'-Wl,--allow-multiple-definition',
language: 'fortran',
)
endif

fc = meson.get_compiler('fortran')
fc_id = fc.get_id()
ca = [] # compile args
la = [] # link args

if fc_id == 'gcc'
add_project_arguments(
ca += [
'-ffree-line-length-none',
'-fbacktrace',
language: 'fortran',
)
elif fc_id == 'intel'
add_project_arguments(
]
if os == 'windows'
la += ['-Wl,--allow-multiple-definition']
endif
elif fc_id == 'intel-cl' or fc_id == 'intel-llvm-cl'
ca += [
'/traceback',
'/fpp',
]
elif fc_id == 'intel' or fc_id == 'intel-llvm'
ca += [
'-traceback',
language: 'fortran',
)
]
elif fc_id == 'pgi' or fc_id == 'nvidia_hpc'
add_project_arguments(
ca += [
'-Mbackslash',
'-Mallocatable=03',
'-traceback',
language: 'fortran',
)
]
elif fc_id == 'flang'
add_project_arguments(
ca += [
'-Mbackslash',
'-Mallocatable=03',
language: 'fortran',
)
]
endif

add_project_arguments(fc.get_supported_arguments(ca), language: 'fortran')
add_project_link_arguments(fc.get_supported_arguments(la), language: 'fortran')

if get_option('openmp')
omp_dep = dependency('openmp')
lib_deps += omp_dep
Expand Down