@@ -15,9 +15,6 @@ check_fortran_source_compiles("
1515 HAVE_ERROR_STOP_IN_PURE
1616 SRC_EXT ".f90"
1717 )
18- if (HAVE_ERROR_STOP_IN_PURE)
19- add_definitions (-DHAVE_ERROR_STOP_IN_PURE)
20- endif ()
2118
2219# Check support for Fortran 2018 variable stop code
2320check_fortran_source_compiles("
@@ -29,14 +26,46 @@ check_fortran_source_compiles("
2926"
3027 HAVE_VARIABLE_STOP_CODE
3128 SRC_EXT ".f90" )
32- if (HAVE_VARIABLE_STOP_CODE)
33- add_definitions (-DHAVE_VARIABLE_STOP_CODE)
34- endif ()
3529
3630if ("${CMAKE_Fortran_COMPILER_ID} " MATCHES "GNU" )
3731 set (CMAKE_REQUIRED_FLAGS ${OLD_REQUIRED_FLAGS} )
3832endif ()
3933
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+
4069#Toggle C preprocessor macro for turning assertions on or off
4170if (NO_ASSERTIONS)
4271 target_compile_definitions ( opencoarrays_test_utilities
4776 PUBLIC "-DUSE_ASSERTIONS=.true."
4877 )
4978endif ()
50-
51- add_library ( opencoarrays_test_utilities
52- object_interface.f90
53- assertions_interface.F90
54- assertions_implementation.F90
55- )
0 commit comments