@@ -24,6 +24,24 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
24
24
25
25
# Common compilation step setup
26
26
27
+ check_cxx_compiler_flag(-Winstantiation-after-specialization
28
+ HAS_INST_AFTER_SPEC)
29
+
30
+ target_compile_options (
31
+ ${LIB_OBJ_NAME}
32
+ PRIVATE
33
+ ${ARG_COMPILE_OPTIONS}
34
+ $<$<BOOL :${HAS_INST_AFTER_SPEC} >:-Winstantiation-after-specialization>
35
+ PUBLIC
36
+ $<$<NOT :$<BOOL :${MSVC} >>:-fvisibility=hidden -fvisibility-inlines-hidden>
37
+ # Sycl math built-in macros cause a GCC 4.6 'note' to be output
38
+ # repeatedly.
39
+ # => note: the ABI for passing parameters with 32-byte alignment has
40
+ # changed in GCC 4.6
41
+ # Seems to be no way to suppress it except use -Wno-psabi
42
+ $<$<NOT :$<BOOL :${MSVC} >>:-Wno-psabi>
43
+ )
44
+
27
45
target_compile_definitions (
28
46
${LIB_OBJ_NAME}
29
47
PRIVATE
@@ -107,10 +125,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
107
125
)
108
126
endif ()
109
127
110
- if (ARG_COMPILE_OPTIONS)
111
- target_compile_options (${LIB_OBJ_NAME} PRIVATE ${ARG_COMPILE_OPTIONS} )
112
- endif ()
113
-
114
128
add_dependencies (${LIB_OBJ_NAME}
115
129
sycl-headers
116
130
)
@@ -162,14 +176,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
162
176
# Install stripped PDB
163
177
add_stripped_pdb(${LIB_NAME} )
164
178
else ()
165
- target_compile_options (${LIB_OBJ_NAME} PUBLIC
166
- -fvisibility=hidden -fvisibility-inlines-hidden)
167
-
168
- # Sycl math built-in macros cause a GCC 4.6 'note' to be output repeatedly.
169
- # => note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
170
- # Seems to be no way to suppress it except use -Wno-psabi
171
- target_compile_options (${LIB_OBJ_NAME} PUBLIC -Wno-psabi)
172
-
173
179
if (UNIX AND NOT APPLE )
174
180
set (linker_script "${CMAKE_CURRENT_SOURCE_DIR} /ld-version-script.txt" )
175
181
target_link_libraries (
@@ -203,13 +209,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
203
209
VERSION ${SYCL_VERSION_STRING}
204
210
SOVERSION ${SYCL_MAJOR_VERSION} )
205
211
206
- check_cxx_compiler_flag(-Winstantiation-after-specialization
207
- HAS_INST_AFTER_SPEC)
208
- if (HAS_INST_AFTER_SPEC)
209
- target_compile_options (${LIB_OBJ_NAME} PRIVATE
210
- -Winstantiation-after-specialization)
211
- endif ()
212
-
213
212
# When building using icx on Windows, the VERSION file
214
213
# produced by cmake is used in source code
215
214
# when including '<version>' because Windows is
0 commit comments