This commit is contained in:
Viktor Szakats 2025-08-06 23:15:22 +02:00
parent 9eb1434b00
commit eb4e5fb0ab
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -32,12 +32,12 @@ set(_all "all")
foreach(_target IN LISTS check_PROGRAMS _all)
set(_target_name "curl-example-${_target}")
if(_target STREQUAL "all")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
set(_example_c "${check_PROGRAMS}")
list(TRANSFORM _example_c APPEND ".c")
add_library(${_target_name} OBJECT EXCLUDE_FROM_ALL ${_example_c})
message(STATUS "|${_example_c}|")
if(CMAKE_VERSION VERSION_LESS 3.12)
continue()
endif()
set(_example_c "${check_PROGRAMS}")
list(TRANSFORM _example_c APPEND ".c")
add_library(${_target_name} OBJECT EXCLUDE_FROM_ALL ${_example_c})
else()
set(_onetest ${_target_name}) # ends with a single, existing test for curl-examples-build target
add_executable(${_target_name} EXCLUDE_FROM_ALL "${_target}.c")