Skip to content
21 changes: 19 additions & 2 deletions src/fpm/manifest/feature_collection.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module fpm_manifest_feature_collection
id_unknown, id_gcc, id_f95, id_caf, &
id_intel_classic_nix, id_intel_classic_mac, id_intel_classic_windows, &
id_intel_llvm_nix, id_intel_llvm_windows, id_intel_llvm_unknown, &
id_pgi, id_nvhpc, id_nag, id_flang, id_lahey, id_lfortran, id_all
id_pgi, id_nvhpc, id_nag, id_flang, id_lahey, id_lfortran, id_all, &
get_debug_compile_flags, get_release_compile_flags
use fpm_strings, only: string_t, lower, operator(==), split, str
use tomlf, only: toml_table, toml_array, toml_key, toml_stat
use fpm_toml, only: get_value, len, serializable_t, set_value, set_string, set_list, add_table, &
Expand Down Expand Up @@ -921,8 +922,24 @@ function default_variant(name, compiler_id, os_type, flags) result(feature)
feature%name = name
feature%platform%compiler = compiler_id
feature%platform%os_type = os_type
feature%flags = flags
feature%default = .true. ! These are built-in features

! FFLAGS
! The argument flags is no more needed but it is kept for backward compatibility
! flags are hard-coded in default_release/debug_feature
! It might better to be pulled from default compile flags defined in fpm_compiler.F90
! TODO: Validate this change
call get_debug_compile_flags(compiler_id, feature%flags)

! test if release is requested
if (name == "release") call get_release_compile_flags(compiler_id, feature%flags)

! CFLAGS
! Equivalent function of get_debug/release_compile_flags must be implemented in fpm_compiler.F90
! Hot fix: hard-coded c_flags=-fPIC (especially needed for shared library)
! TODO: Validate this change
feature%c_flags = "-fPIC"

end function default_variant


Expand Down
Loading