Skip to content

[SYCL][NFC] SYCL RT CMakeLists cleanup [6/N] #17420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)

# Common compilation step setup

check_cxx_compiler_flag(-Winstantiation-after-specialization
HAS_INST_AFTER_SPEC)

target_compile_options(
${LIB_OBJ_NAME}
PRIVATE
${ARG_COMPILE_OPTIONS}
$<$<BOOL:${HAS_INST_AFTER_SPEC}>:-Winstantiation-after-specialization>
PUBLIC
$<$<NOT:$<BOOL:${MSVC}>>:-fvisibility=hidden -fvisibility-inlines-hidden>
# Sycl math built-in macros cause a GCC 4.6 'note' to be output
# repeatedly.
# => note: the ABI for passing parameters with 32-byte alignment has
# changed in GCC 4.6
# Seems to be no way to suppress it except use -Wno-psabi
$<$<NOT:$<BOOL:${MSVC}>>:-Wno-psabi>
)

target_compile_definitions(
${LIB_OBJ_NAME}
PRIVATE
Expand Down Expand Up @@ -107,10 +125,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
)
endif()

if (ARG_COMPILE_OPTIONS)
target_compile_options(${LIB_OBJ_NAME} PRIVATE ${ARG_COMPILE_OPTIONS})
endif()

add_dependencies(${LIB_OBJ_NAME}
sycl-headers
)
Expand Down Expand Up @@ -162,14 +176,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
# Install stripped PDB
add_stripped_pdb(${LIB_NAME})
else()
target_compile_options(${LIB_OBJ_NAME} PUBLIC
-fvisibility=hidden -fvisibility-inlines-hidden)

# Sycl math built-in macros cause a GCC 4.6 'note' to be output repeatedly.
# => note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
# Seems to be no way to suppress it except use -Wno-psabi
target_compile_options(${LIB_OBJ_NAME} PUBLIC -Wno-psabi)

if (UNIX AND NOT APPLE)
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/ld-version-script.txt")
target_link_libraries(
Expand Down Expand Up @@ -203,13 +209,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
VERSION ${SYCL_VERSION_STRING}
SOVERSION ${SYCL_MAJOR_VERSION})

check_cxx_compiler_flag(-Winstantiation-after-specialization
HAS_INST_AFTER_SPEC)
if (HAS_INST_AFTER_SPEC)
target_compile_options(${LIB_OBJ_NAME} PRIVATE
-Winstantiation-after-specialization)
endif()

# When building using icx on Windows, the VERSION file
# produced by cmake is used in source code
# when including '<version>' because Windows is
Expand Down