Skip to content

Commit

Permalink
cmake: Fix -pthread flags in summary
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jan 23, 2025
1 parent 188b021 commit 2083e9c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmake/module/GetTargetInterface.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ endfunction()
function(get_target_interface var config target property)
get_target_property(result ${target} INTERFACE_${property})
if(result)
evaluate_generator_expressions(result "${config}")
# On systems where pthread functionality is not provided by
# the C library implementation, the CMake FindThreads module
# sets the Threads::Threads target's compile options to
# generator expressions that evaluate to `-pthread` in this
# project.
# To improve the readability of the configuration summary,
# we skip these generator expressions.
if(${target} STREQUAL "Threads::Threads" AND ${property} STREQUAL "COMPILE_OPTIONS")
set(result -pthread)
else()
evaluate_generator_expressions(result "${config}")
endif()
list(JOIN result " " result)
else()
set(result)
Expand Down

0 comments on commit 2083e9c

Please sign in to comment.