Skip to content

Commit

Permalink
Switch link_check to executable to avoid -fPIC issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Oct 12, 2024
1 parent 881eafa commit 6062e4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions cmake/CCCLGenerateHeaderTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ function(cccl_generate_header_tests target_name project_include_path)

# Check that all functions in headers are either template functions or inline:
set(link_target ${target_name}.link_check)
add_library(${link_target} SHARED)
add_executable(${link_target} "${CCCL_SOURCE_DIR}/cmake/link_check_main.cpp")
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.
Expand Down
4 changes: 4 additions & 0 deletions cmake/link_check_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main()
{
return 0;
}

0 comments on commit 6062e4b

Please sign in to comment.