Commit 4201a11c authored by Ben Boeckel's avatar Ben Boeckel
Browse files

Tests: add tests for empty-value keyword arguments in target_*

Not all of these commands accept non-compilable (i.e., IMPORTED)
targets, so those calls are currently just commented out. If they ever
do start to accept them, the tests should be enabled.
parent 9e78be80
......@@ -342,11 +342,16 @@ endif()
add_RunCMake_test(File_Generate)
add_RunCMake_test(ExportWithoutLanguage)
add_RunCMake_test(target_link_directories)
add_RunCMake_test(target_link_libraries)
add_RunCMake_test(add_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
add_RunCMake_test(target_compile_definitions)
add_RunCMake_test(target_compile_features)
add_RunCMake_test(target_compile_options)
add_RunCMake_test(target_include_directories)
add_RunCMake_test(target_sources)
add_RunCMake_test(CheckModules)
add_RunCMake_test(CheckIPOSupported)
add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
......
cmake_minimum_required(VERSION 3.11)
project(${RunCMake_TEST} LANGUAGES NONE)
include(${RunCMake_TEST}.cmake)
include(RunCMake)
run_cmake(empty_keyword_args)
CMake Error at empty_keyword_args.cmake:2 \(target_compile_definitions\):
target_compile_definitions may only set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
CMakeLists.txt:5 \(include\)
add_library(iface INTERFACE)
target_compile_definitions(iface PUBLIC PRIVATE INTERFACE)
# Cannot be called with non-compilable targets.
#add_library(imported UNKNOWN IMPORTED)
#target_compile_definitions(imported PUBLIC PRIVATE INTERFACE)
......@@ -12,3 +12,4 @@ run_cmake(no_matching_cxx_feature)
run_cmake(not_a_c_feature)
run_cmake(no_matching_c_feature)
run_cmake(cxx_not_enabled)
run_cmake(empty_keyword_args)
CMake Error at empty_keyword_args.cmake:2 \(target_compile_features\):
target_compile_features may only set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
add_library(iface INTERFACE)
target_compile_features(iface PUBLIC PRIVATE INTERFACE)
# Cannot be called with non-compilable targets.
#add_library(imported UNKNOWN IMPORTED)
#target_compile_features(imported PUBLIC PRIVATE INTERFACE)
cmake_minimum_required(VERSION 3.11)
project(${RunCMake_TEST} LANGUAGES NONE)
include(${RunCMake_TEST}.cmake)
include(RunCMake)
run_cmake(empty_keyword_args)
CMake Error at empty_keyword_args.cmake:2 \(target_compile_options\):
target_compile_options may only set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
CMakeLists.txt:5 \(include\)
add_library(iface INTERFACE)
target_compile_options(iface PUBLIC PRIVATE INTERFACE)
# Cannot be called with non-compilable targets.
#add_library(imported UNKNOWN IMPORTED)
#target_compile_options(imported PUBLIC PRIVATE INTERFACE)
cmake_minimum_required(VERSION 3.11)
project(${RunCMake_TEST} LANGUAGES NONE)
include(${RunCMake_TEST}.cmake)
include(RunCMake)
run_cmake(empty_keyword_args)
CMake Error at empty_keyword_args.cmake:2 \(target_include_directories\):
target_include_directories may only set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
CMakeLists.txt:5 \(include\)
add_library(iface INTERFACE)
target_include_directories(iface PUBLIC PRIVATE INTERFACE)
# Cannot be called with non-compilable targets.
#add_library(imported UNKNOWN IMPORTED)
#target_include_directories(imported PUBLIC PRIVATE INTERFACE)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment