Skip to content
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

[cmake] use target_compile_definitions #4310

Merged
merged 1 commit into from
Feb 25, 2025
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
8 changes: 4 additions & 4 deletions build/cmake/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ endif()

macro (add_definition target var)
if (NOT ("${${var}}" STREQUAL ""))
set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS "${var}=__attribute__((visibility(\"${${var}}\")))")
target_compile_definitions(${target} PUBLIC "${var}=__attribute__((visibility(\"${${var}}\")))")
endif ()
endmacro ()

Expand All @@ -126,7 +126,7 @@ if (ZSTD_BUILD_SHARED)
target_include_directories(libzstd_shared INTERFACE $<BUILD_INTERFACE:${PUBLIC_INCLUDE_DIRS}>)
list(APPEND library_targets libzstd_shared)
if (ZSTD_MULTITHREAD_SUPPORT)
set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
target_compile_definitions(libzstd_shared PUBLIC ZSTD_MULTITHREAD)
if (UNIX)
target_link_libraries(libzstd_shared ${THREADS_LIBS})
endif ()
Expand All @@ -140,7 +140,7 @@ if (ZSTD_BUILD_STATIC)
target_include_directories(libzstd_static INTERFACE $<BUILD_INTERFACE:${PUBLIC_INCLUDE_DIRS}>)
list(APPEND library_targets libzstd_static)
if (ZSTD_MULTITHREAD_SUPPORT)
set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
target_compile_definitions(libzstd_static PUBLIC ZSTD_MULTITHREAD)
if (UNIX)
target_link_libraries(libzstd_static ${THREADS_LIBS})
endif ()
Expand Down Expand Up @@ -207,7 +207,7 @@ if (ZSTD_BUILD_SHARED)
OUTPUT_NAME zstd
VERSION ${ZSTD_FULL_VERSION}
SOVERSION ${zstd_VERSION_MAJOR})

if (ZSTD_FRAMEWORK)
set_target_properties(
libzstd_shared
Expand Down
Loading