mirror of
https://github.com/curl/curl.git
synced 2026-06-09 16:54:15 +03:00
fixup?
This commit is contained in:
parent
87484dd53a
commit
1f4ba49bec
1 changed files with 11 additions and 11 deletions
|
|
@ -37,6 +37,17 @@ foreach(_target IN LISTS check_PROGRAMS _all) # keep '_all' last
|
|||
set(_examples_c "${check_PROGRAMS}")
|
||||
list(TRANSFORM _examples_c APPEND ".c")
|
||||
add_library(${_target_name} OBJECT EXCLUDE_FROM_ALL ${_examples_c})
|
||||
if(MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
# CMake generates a static library for the OBJECT target. Which triggers warnings:
|
||||
# warning LNK4006: main already defined in ....obj; second definition ignored
|
||||
# warning LNK4221: This object file does not define any previously undefined public symbols,
|
||||
# so it will not be used by any link operation that consumes this library
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
set_target_properties(${_target_name} PROPERTIES STATIC_LIBRARY_OPTIONS "-ignore:4006;-ignore:4221")
|
||||
else()
|
||||
set_target_properties(${_target_name} PROPERTIES STATIC_LIBRARY_FLAGS "-ignore:4006;-ignore:4221")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set(_examples_c "")
|
||||
foreach(_src IN LISTS check_PROGRAMS)
|
||||
|
|
@ -46,17 +57,6 @@ foreach(_target IN LISTS check_PROGRAMS _all) # keep '_all' last
|
|||
endif()
|
||||
add_custom_target(curl-examples-build) # Special target to compile all tests quickly and build a single test to probe linkage
|
||||
add_dependencies(curl-examples-build ${_target_name} ${_all_plus_one}) # Include a full build of a single test
|
||||
if(MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
# CMake generates a static library for the OBJECT target. Which triggers warnings:
|
||||
# warning LNK4006: main already defined in ....obj; second definition ignored
|
||||
# warning LNK4221: This object file does not define any previously undefined public symbols,
|
||||
# so it will not be used by any link operation that consumes this library
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
set_target_properties(curl-examples-build PROPERTIES STATIC_LIBRARY_OPTIONS "-ignore:4006;-ignore:4221")
|
||||
else()
|
||||
set_target_properties(curl-examples-build PROPERTIES STATIC_LIBRARY_FLAGS "-ignore:4006;-ignore:4221")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set(_all_plus_one ${_target_name}) # Save the last test for the curl-examples-build target
|
||||
add_executable(${_target_name} EXCLUDE_FROM_ALL "${_target}.c")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue