@@ -15,9 +15,6 @@ check_fortran_source_compiles("
15
15
HAVE_ERROR_STOP_IN_PURE
16
16
SRC_EXT ".f90"
17
17
)
18
- if (HAVE_ERROR_STOP_IN_PURE )
19
- add_definitions (-DHAVE_ERROR_STOP_IN_PURE )
20
- endif ()
21
18
22
19
# Check support for Fortran 2018 variable stop code
23
20
check_fortran_source_compiles ("
@@ -29,14 +26,46 @@ check_fortran_source_compiles("
29
26
"
30
27
HAVE_VARIABLE_STOP_CODE
31
28
SRC_EXT ".f90" )
32
- if (HAVE_VARIABLE_STOP_CODE )
33
- add_definitions (-DHAVE_VARIABLE_STOP_CODE )
34
- endif ()
35
29
36
30
if ("${CMAKE_Fortran_COMPILER_ID} " MATCHES "GNU" )
37
31
set (CMAKE_REQUIRED_FLAGS ${OLD_REQUIRED_FLAGS} )
38
32
endif ()
39
33
34
+ add_library ( oc_test_interfaces OBJECT
35
+ object_interface.f90
36
+ assertions_interface.F90
37
+ )
38
+ add_library ( opencoarrays_test_utilities
39
+ assertions_implementation.F90
40
+ $< TARGET_OBJECTS:oc_test_interfaces>
41
+ )
42
+ set_target_properties (opencoarrays_test_utilities
43
+ PROPERTIES
44
+ Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_INCLUDEDIR} /${mod_dir_tail} " )
45
+ set_target_properties (oc_test_interfaces
46
+ PROPERTIES
47
+ Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_INCLUDEDIR} /${mod_dir_tail} " )
48
+
49
+ target_compile_options (oc_test_interfaces
50
+ PUBLIC
51
+ "-fcoarray=lib" )
52
+ target_compile_options (opencoarrays_test_utilities
53
+ PUBLIC
54
+ "-fcoarray=lib" )
55
+
56
+ if (HAVE_ERROR_STOP_IN_PURE )
57
+ target_compile_definitions (oc_test_interfaces
58
+ PUBLIC -DHAVE_ERROR_STOP_IN_PURE )
59
+ target_compile_definitions (opencoarrays_test_utilities
60
+ PUBLIC -DHAVE_ERROR_STOP_IN_PURE )
61
+ endif ()
62
+ if (HAVE_VARIABLE_STOP_CODE )
63
+ target_compile_definitions (oc_test_interfaces
64
+ PUBLIC -DHAVE_VARIABLE_STOP_CODE )
65
+ target_compile_definitions (opencoarrays_test_utilities
66
+ PUBLIC -DHAVE_VARIABLE_STOP_CODE )
67
+ endif ()
68
+
40
69
#Toggle C preprocessor macro for turning assertions on or off
41
70
if (NO_ASSERTIONS )
42
71
target_compile_definitions ( opencoarrays_test_utilities
47
76
PUBLIC "-DUSE_ASSERTIONS=.true."
48
77
)
49
78
endif ()
50
-
51
- add_library ( opencoarrays_test_utilities
52
- object_interface.f90
53
- assertions_interface.F90
54
- assertions_implementation.F90
55
- )
0 commit comments