Commit 234a069d authored by Brad King's avatar Brad King

Tests: Speed up RunCMake.GeneratorExpression

Avoid enabling languages in cases that do not need them.
parent 7c30a3a3
CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\):
CMake Error at BadTargetTypeObject.cmake:2 \(add_custom_target\):
Error evaluating generator expression:
\$<TARGET_FILE:objlib>
......@@ -7,7 +7,7 @@ CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\):
CMake Error at BadTargetTypeObject.cmake:2 \(add_custom_target\):
Error evaluating generator expression:
\$<TARGET_SONAME_FILE:objlib>
......@@ -16,7 +16,7 @@ CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\):
CMake Error at BadTargetTypeObject.cmake:2 \(add_custom_target\):
Error evaluating generator expression:
\$<TARGET_LINKER_FILE:objlib>
......
enable_language(C)
add_library(objlib OBJECT empty.c)
add_library(objlib OBJECT)
add_custom_target(check ALL COMMAND echo
$<TARGET_FILE:objlib>
$<TARGET_SONAME_FILE:objlib>
......
project(CMP0044-WARN)
enable_language(C)
string(TOLOWER ${CMAKE_C_COMPILER_ID} lc_test)
if (lc_test STREQUAL CMAKE_C_COMPILER_ID)
......
CMake Error at COMPILE_LANGUAGE-add_custom_command.cmake:6 \(add_custom_command\):
CMake Error at COMPILE_LANGUAGE-add_custom_command.cmake:2 \(add_custom_command\):
Error evaluating generator expression:
\$<COMPILE_LANGUAGE>
......
enable_language(C)
add_library(empty empty.c)
add_custom_command(TARGET empty PRE_BUILD
add_custom_target(drive)
add_custom_command(TARGET drive PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E echo $<COMPILE_LANGUAGE>
)
CMake Error at COMPILE_LANGUAGE-add_custom_target.cmake:4 \(add_custom_target\):
CMake Error at COMPILE_LANGUAGE-add_custom_target.cmake:1 \(add_custom_target\):
Error evaluating generator expression:
\$<COMPILE_LANGUAGE>
......
enable_language(C)
add_custom_target(empty
add_custom_target(drive
COMMAND ${CMAKE_COMMAND} -E echo $<COMPILE_LANGUAGE>
)
CMake Error at COMPILE_LANGUAGE-add_executable.cmake:4 \(add_executable\):
CMake Error at COMPILE_LANGUAGE-add_executable.cmake:1 \(add_executable\):
Error evaluating generator expression:
\$<COMPILE_LANGUAGE>
......
enable_language(C)
add_executable(empty empty.$<COMPILE_LANGUAGE>)
CMake Error at COMPILE_LANGUAGE-add_library.cmake:4 \(add_library\):
CMake Error at COMPILE_LANGUAGE-add_library.cmake:1 \(add_library\):
Error evaluating generator expression:
\$<COMPILE_LANGUAGE>
......
enable_language(C)
add_library(empty empty.$<COMPILE_LANGUAGE>)
CMake Error at COMPILE_LANGUAGE-target_sources.cmake:5 \(target_sources\):
CMake Error at COMPILE_LANGUAGE-target_sources.cmake:2 \(target_sources\):
Error evaluating generator expression:
\$<COMPILE_LANGUAGE>
......
enable_language(C)
add_library(empty empty.c)
add_library(empty)
target_sources(empty PRIVATE empty.$<COMPILE_LANGUAGE>)
CMake Error at NonValidTarget-CXX_COMPILER_ID.cmake:4 \(add_custom_command\):
CMake Error at NonValidTarget-CXX_COMPILER_ID.cmake:1 \(add_custom_command\):
Error evaluating generator expression:
\$<CXX_COMPILER_ID>
......
enable_language(CXX)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<CXX_COMPILER_ID>.cpp"
)
add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
CMake Error at NonValidTarget-CXX_COMPILER_VERSION.cmake:4 \(add_custom_command\):
CMake Error at NonValidTarget-CXX_COMPILER_VERSION.cmake:1 \(add_custom_command\):
Error evaluating generator expression:
\$<CXX_COMPILER_VERSION>
......
enable_language(CXX)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<CXX_COMPILER_VERSION>.cpp"
)
add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
CMake Error at NonValidTarget-C_COMPILER_ID.cmake:4 \(add_custom_command\):
CMake Error at NonValidTarget-C_COMPILER_ID.cmake:1 \(add_custom_command\):
Error evaluating generator expression:
\$<C_COMPILER_ID>
......
enable_language(CXX)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_ID>.cpp"
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.c" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_ID>.c"
)
add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c")
CMake Error at NonValidTarget-C_COMPILER_VERSION.cmake:4 \(add_custom_command\):
CMake Error at NonValidTarget-C_COMPILER_VERSION.cmake:1 \(add_custom_command\):
Error evaluating generator expression:
\$<C_COMPILER_VERSION>
......
enable_language(CXX)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_VERSION>.cpp"
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.c" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_VERSION>.c"
)
add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c")
CMake Error at NonValidTarget-TARGET_POLICY.cmake:4 \(add_custom_command\):
CMake Error at NonValidTarget-TARGET_POLICY.cmake:1 \(add_custom_command\):
Error evaluating generator expression:
\$<TARGET_POLICY:CMP0004>
......
enable_language(CXX)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<TARGET_POLICY:CMP0004>.cpp"
)
add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
CMake Error at NonValidTarget-TARGET_PROPERTY.cmake:4 \(add_custom_command\):
CMake Error at NonValidTarget-TARGET_PROPERTY.cmake:1 \(add_custom_command\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:NotAProperty>
......
enable_language(CXX)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<TARGET_PROPERTY:NotAProperty>.cpp"
)
add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
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