summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-16 15:31:16 +0000
committerKitware Robot <kwrobot@kitware.com>2020-03-16 11:31:25 -0400
commiteea528fd92a9a448a473ac031f5e7ca3f3ba917f (patch)
tree8c21fe81db3a1c135518649d26ad64858556330d /Tests
parent9ad554a1fce78821358d61d8cd010f595b53c098 (diff)
parent9728839b9e0d9a12f3c70c6f221f3f6482894ce0 (diff)
downloadcmake-eea528fd92a9a448a473ac031f5e7ca3f3ba917f.tar.gz
Merge topic 'gnu-as'
9728839b9e ASM: Fix executable link lines with GNU 'as' tool as CMAKE_ASM_COMPILER 5932f0be4f ASM: Fix depfile flags for GNU 'as' tool 0d0aa98c84 ASM: Record vendor-specific output matched to identify assembler ee3ec27465 CMakeDetermineCompilerId: Set locale to C for vendor output match Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4460
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt4
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS.cmake13
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake1
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake1
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/BuildDepends/gnu_as.s1
-rw-r--r--Tests/RunCMake/CMakeLists.txt15
7 files changed, 39 insertions, 1 deletions
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
new file mode 100644
index 0000000000..c4326ae941
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
@@ -0,0 +1,4 @@
+-- The ASM compiler identification is GNU
+-- Found assembler: [^
+]*/as(\.exe)?
+-- CMAKE_ASM_COMPILER_ID_VENDOR_MATCH='GNU assembler'
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.cmake
new file mode 100644
index 0000000000..21921ef18b
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.cmake
@@ -0,0 +1,13 @@
+enable_language(ASM)
+
+# Validate undocumented implementation detail.
+message(STATUS "CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH='${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH}'")
+
+add_library(gnu_as STATIC gnu_as.s)
+target_include_directories(gnu_as PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"$<TARGET_FILE:gnu_as>|${CMAKE_CURRENT_BINARY_DIR}/gnu_as.inc\"
+ )
+")
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake
new file mode 100644
index 0000000000..15a5e96bac
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake
@@ -0,0 +1 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/gnu_as.inc" "")
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake
new file mode 100644
index 0000000000..15a5e96bac
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake
@@ -0,0 +1 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/gnu_as.inc" "")
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 14ae2439b7..753417dab7 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -103,3 +103,8 @@ endfunction()
if(RunCMake_GENERATOR STREQUAL "Xcode")
run_ReGeneration(regenerate-project)
endif()
+
+if(CMake_TEST_BuildDepends_GNU_AS)
+ set(ENV{ASM} "${CMake_TEST_BuildDepends_GNU_AS}")
+ run_BuildDepends(GNU-AS)
+endif()
diff --git a/Tests/RunCMake/BuildDepends/gnu_as.s b/Tests/RunCMake/BuildDepends/gnu_as.s
new file mode 100644
index 0000000000..a2e7dfb0d3
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/gnu_as.s
@@ -0,0 +1 @@
+.include "gnu_as.inc"
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 4b5475edb1..f99f704ca0 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -169,7 +169,20 @@ if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND)
set(autogen_with_qt5 TRUE)
endif ()
add_RunCMake_test(Autogen -Dwith_qt5=${autogen_with_qt5})
-add_RunCMake_test(BuildDepends)
+if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS
+ AND CMAKE_C_COMPILER_ID STREQUAL "GNU"
+ AND CMAKE_GENERATOR MATCHES "^Ninja"
+ )
+ execute_process(COMMAND "${CMAKE_C_COMPILER}" -print-prog-name=as
+ RESULT_VARIABLE _gnu_res
+ OUTPUT_VARIABLE _gnu_as OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+ if(_gnu_res EQUAL 0 AND _gnu_as)
+ set(CMake_TEST_BuildDepends_GNU_AS "${_gnu_as}")
+ endif()
+endif()
+add_RunCMake_test(BuildDepends
+ -DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS}
+ )
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
endif()