@@ -35,7 +35,8 @@ module fpm_targets
35
35
private
36
36
37
37
public FPM_TARGET_UNKNOWN, FPM_TARGET_EXECUTABLE, &
38
- FPM_TARGET_ARCHIVE, FPM_TARGET_OBJECT
38
+ FPM_TARGET_ARCHIVE, FPM_TARGET_OBJECT, &
39
+ FPM_TARGET_C_OBJECT
39
40
public build_target_t, build_target_ptr
40
41
public targets_from_sources, resolve_module_dependencies
41
42
public resolve_target_linking, add_target, add_dependency
@@ -50,7 +51,8 @@ module fpm_targets
50
51
integer , parameter :: FPM_TARGET_ARCHIVE = 2
51
52
! > Target type is compiled object
52
53
integer , parameter :: FPM_TARGET_OBJECT = 3
53
-
54
+ ! > Target type is c compiled object
55
+ integer , parameter :: FPM_TARGET_C_OBJECT = 4
54
56
55
57
! > Wrapper type for constructing arrays of `[[build_target_t]]` pointers
56
58
type build_target_ptr
@@ -194,7 +196,8 @@ subroutine build_target_list(targets,model)
194
196
case (FPM_UNIT_MODULE,FPM_UNIT_SUBMODULE,FPM_UNIT_SUBPROGRAM,FPM_UNIT_CSOURCE)
195
197
196
198
call add_target(targets,source = sources(i), &
197
- type = FPM_TARGET_OBJECT,&
199
+ type = merge (FPM_TARGET_C_OBJECT,FPM_TARGET_OBJECT,&
200
+ sources(i)% unit_type== FPM_UNIT_CSOURCE), &
198
201
output_file = get_object_name(sources(i)))
199
202
200
203
if (with_lib .and. sources(i)% unit_scope == FPM_SCOPE_LIB) then
0 commit comments