Skip to content

Commit

Permalink
Use target_compile_options instead of set_target_properties
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
  • Loading branch information
PetrShumilov committed Mar 3, 2025
1 parent 4be82e5 commit 0477f7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ function(vk_add_library_pic)
add_library(${ARGV})
set_target_properties(${ARGV0} PROPERTIES
POSITION_INDEPENDENT_CODE 1
COMPILE_FLAGS "-fPIC"
)
target_compile_options(${ARGV0} PRIVATE -fPIC)
add_vk_library_to_pic_namespace(${ARGV0})
endfunction()

function(vk_add_library_no_pic)
add_library(${ARGV})
set_target_properties(${ARGV0} PROPERTIES
POSITION_INDEPENDENT_CODE 0
COMPILE_FLAGS "-fno-pic -static"
)
target_compile_options(${ARGV0} PRIVATE -fno-pic -static)
add_vk_library_to_no_pic_namespace(${ARGV0})
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion runtime-light/runtime-light.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set_target_properties(runtime-light-pic PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${BASE_DIR}/objs)
target_compile_options(
runtime-light-pic PUBLIC -stdlib=libc++ -iquote ${GENERATED_DIR}
${THIRD_PARTY_INCLUDE} -fPIC -O3)
${THIRD_PARTY_INCLUDE} -O3)
target_link_options(runtime-light-pic PUBLIC -stdlib=libc++ -static-libstdc++)
# add statically linking libraries
string(JOIN " " ABSEIL_LIBS ${ABSEIL_LIBS})
Expand Down

0 comments on commit 0477f7e

Please sign in to comment.