Skip to content

build: obsolete options which have long been deprecated #29824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 12 additions & 37 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1542,15 +1542,10 @@ endfunction()
# Sources to add into this library.
function(add_swift_host_library name)
set(options
FORCE_BUILD_OPTIMIZED
SHARED
STATIC)
set(single_parameter_options)
set(multiple_parameter_options
C_COMPILE_FLAGS
DEPENDS
FILE_DEPENDS
LINK_LIBRARIES
LLVM_LINK_COMPONENTS)

cmake_parse_arguments(ASHL
Expand All @@ -1560,22 +1555,6 @@ function(add_swift_host_library name)
${ARGN})
set(ASHL_SOURCES ${ASHL_UNPARSED_ARGUMENTS})

if(ASHL_FORCE_BUILD_OPTIMIZED)
message(SEND_ERROR "library ${name} is using FORCE_BUILD_OPTIMIZED flag which is deprecated. Please use target_compile_options instead")
endif()
if(ASHL_C_COMPILE_FLAGS)
message(SEND_ERROR "library ${name} is using C_COMPILE_FLAGS parameter which is deprecated. Please use target_compile_definitions, target_compile_options, or target_include_directories instead")
endif()
if(ASHL_DEPENDS)
message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated. Please use add_dependencies instead")
endif()
if(ASHL_FILE_DEPENDS)
message(SEND_ERROR "library ${name} is using FILE_DEPENDS parameter which is deprecated.")
endif()
if(ASHL_LINK_LIBRARIES)
message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
endif()

translate_flags(ASHL "${options}")

if(NOT ASHL_SHARED AND NOT ASHL_STATIC)
Expand Down Expand Up @@ -2524,22 +2503,22 @@ endfunction()
# [ARCHITECTURE architecture]
# Architecture to build for.
function(_add_swift_executable_single name)
# Parse the arguments we were given.
set(options)
set(single_parameter_options
ARCHITECTURE
SDK)
set(multiple_parameter_options
COMPILE_FLAGS
DEPENDS
LLVM_LINK_COMPONENTS)
cmake_parse_arguments(SWIFTEXE_SINGLE
"EXCLUDE_FROM_ALL"
"SDK;ARCHITECTURE"
"DEPENDS;LLVM_LINK_COMPONENTS;LINK_LIBRARIES;COMPILE_FLAGS"
"${options}"
"${single_parameter_options}"
"${multiple_parameter_options}"
${ARGN})

set(SWIFTEXE_SINGLE_SOURCES ${SWIFTEXE_SINGLE_UNPARSED_ARGUMENTS})

if(SWIFTEXE_SINGLE_EXCLUDE_FROM_ALL)
message(SEND_ERROR "${name} is using EXCLUDE_FROM_ALL option which is deprecated.")
endif()
if(SWIFTEXE_SINGLE_LINK_LIBRARIES)
message(SEND_ERROR "${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
endif()

# Check arguments.
precondition(SWIFTEXE_SINGLE_SDK MESSAGE "Should specify an SDK")
precondition(SWIFTEXE_SINGLE_ARCHITECTURE MESSAGE "Should specify an architecture")
Expand Down Expand Up @@ -2663,18 +2642,14 @@ endmacro()
function(add_swift_host_tool executable)
set(options)
set(single_parameter_options SWIFT_COMPONENT)
set(multiple_parameter_options LINK_LIBRARIES)
set(multiple_parameter_options)

cmake_parse_arguments(ASHT
"${options}"
"${single_parameter_options}"
"${multiple_parameter_options}"
${ARGN})

if(ASHT_LINK_LIBRARIES)
message(SEND_ERROR "${executable} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
endif()

precondition(ASHT_SWIFT_COMPONENT
MESSAGE "Swift Component is required to add a host tool")

Expand Down