Skip to content

Commit

Permalink
Add -fPIC, formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Oct 12, 2024
1 parent ca79507 commit 881eafa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/CCCLGenerateHeaderTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ function(cccl_generate_header_tests target_name project_include_path)
set(link_target ${target_name}.link_check)
add_library(${link_target} SHARED)
cccl_configure_target(${link_target} ${cccl_configure_target_options})
set_target_properties(${link_target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
# Linking both ${target_name} and $<TARGET_OBJECTS:${target_name}> forces CMake to
# link the same objects twice. The compiler will complain about duplicate symbols if
# any functions are missing inline markup.
target_link_libraries(${link_target} PRIVATE ${target_name} $<TARGET_OBJECTS:${target_name}>)
target_link_libraries(${link_target} PRIVATE
${target_name}
$<TARGET_OBJECTS:${target_name}>
)

endfunction()

0 comments on commit 881eafa

Please sign in to comment.