@@ -122,31 +122,38 @@ set_target_properties(${CBLASLIB}_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
122
122
123
123
if (BUILD_INDEX64_EXT_API)
124
124
# 64bit Integer Interface
125
+ # Define list of C files
125
126
set (SOURCES_64_C)
126
- set (SOURCES_64_F)
127
127
list (APPEND SOURCES_64_C ${SOURCES} )
128
- list (APPEND SOURCES_64_F ${SOURCES} )
129
128
list (FILTER SOURCES_64_C EXCLUDE REGEX "\. f$" )
130
- list (FILTER SOURCES_64_F INCLUDE REGEX "\. f$" )
131
129
list (REMOVE_ITEM SOURCES_64_C cblas_globals.c)
130
+ # Define list of Fortran files
131
+ set (SOURCES_64_F)
132
+ list (APPEND SOURCES_64_F ${SOURCES} )
133
+ list (FILTER SOURCES_64_F INCLUDE REGEX "\. f$" )
134
+ # Copy files so we can set source property specific to /${CBLASLIB}_64_obj target
135
+ file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /${CBLASLIB} _64_fobj)
136
+ file (COPY ${SOURCES_64_F} DESTINATION ${CMAKE_CURRENT_BINARY_DIR} /${CBLASLIB} _64_fobj)
137
+ file (GLOB SOURCES_64_F ${CMAKE_CURRENT_BINARY_DIR} /${CBLASLIB} _64_fobj/*)
138
+ add_library (${CBLASLIB} _64_cobj OBJECT ${SOURCES_64_C} )
139
+ add_library (${CBLASLIB} _64_fobj OBJECT ${SOURCES_64_F} )
140
+ set_target_properties (${CBLASLIB} _64_cobj ${CBLASLIB} _64_fobj PROPERTIES
141
+ POSITION_INDEPENDENT_CODE ON
142
+ Fortran_PREPROCESS ON )
143
+ target_compile_options (${CBLASLIB} _64_cobj PRIVATE -DWeirdNEC -DCBLAS_API64)
144
+ target_compile_options (${CBLASLIB} _64_fobj PRIVATE ${FOPT_ILP64} )
132
145
#Add suffix to all Fortran functions via macros
133
- set (COPT_64_F)
134
146
foreach (F IN LISTS SOURCES_64_F)
147
+ set (COPT_64_F)
135
148
file (STRINGS ${F} ${F} .lst)
136
149
list (FILTER ${F} .lst INCLUDE REGEX "subroutine|external" )
137
150
foreach (FUNC IN LISTS ${F} .lst)
138
151
string (REGEX REPLACE "[ ]*(subroutine|external)[ ]*" "" FUNC ${FUNC} )
139
152
string (REGEX REPLACE "[(][a-zA-Z0-9, ]*[)]" "" FUNC ${FUNC} )
140
153
list (APPEND COPT_64_F "-D${FUNC} =${FUNC} _64" )
141
154
endforeach ()
155
+ set_source_files_properties (${F} PROPERTIES COMPILE_OPTIONS "${COPT_64_F} " )
142
156
endforeach ()
143
- add_library (${CBLASLIB} _64_cobj OBJECT ${SOURCES_64_C} )
144
- add_library (${CBLASLIB} _64_fobj OBJECT ${SOURCES_64_F} )
145
- set_target_properties (${CBLASLIB} _64_cobj ${CBLASLIB} _64_fobj PROPERTIES
146
- POSITION_INDEPENDENT_CODE ON
147
- Fortran_PREPROCESS ON )
148
- target_compile_options (${CBLASLIB} _64_cobj PRIVATE -DWeirdNEC -DCBLAS_API64)
149
- target_compile_options (${CBLASLIB} _64_fobj PRIVATE ${FOPT_ILP64} ${COPT_64_F} )
150
157
endif ()
151
158
152
159
add_library (${CBLASLIB}
0 commit comments