From 844ce140a51ee9ae7e2bc1889bb803ae76c68baa Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Sat, 9 Nov 2024 14:57:46 +0100 Subject: [PATCH] Simplify 'cmake nasm dependency' test case --- .../cmake/28 cmake nasm dependency/meson.build | 18 ++++++------------ .../28 cmake nasm dependency/nativefile.ini.in | 2 -- .../subprojects/{cmTest1.wrap => cmTest.wrap} | 2 +- .../{cmTest2 => cmTest}/CMakeLists.txt | 4 ++-- .../subprojects/{cmTest1 => cmTest}/cmTest.c | 0 .../{cmTest2 => cmTest}/cmTestAsm.asm | 0 .../subprojects/cmTest1/CMakeLists.txt | 5 ----- .../subprojects/cmTest2.wrap | 5 ----- 8 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 test cases/cmake/28 cmake nasm dependency/nativefile.ini.in rename test cases/cmake/28 cmake nasm dependency/subprojects/{cmTest1.wrap => cmTest.wrap} (63%) rename test cases/cmake/28 cmake nasm dependency/subprojects/{cmTest2 => cmTest}/CMakeLists.txt (91%) rename test cases/cmake/28 cmake nasm dependency/subprojects/{cmTest1 => cmTest}/cmTest.c (100%) rename test cases/cmake/28 cmake nasm dependency/subprojects/{cmTest2 => cmTest}/cmTestAsm.asm (100%) delete mode 100644 test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/CMakeLists.txt delete mode 100644 test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2.wrap diff --git a/test cases/cmake/28 cmake nasm dependency/meson.build b/test cases/cmake/28 cmake nasm dependency/meson.build index 1ddd6ec7c343..56780c711be1 100644 --- a/test cases/cmake/28 cmake nasm dependency/meson.build +++ b/test cases/cmake/28 cmake nasm dependency/meson.build @@ -4,20 +4,14 @@ if get_option('backend').startswith('vs') error('MESON_SKIP_TEST: nasm is not supported by vs backend') endif -# This test aims to trigger CMakeToolchain.update_cmake_compiler_state() _twice_, -# as the 2nd CMake compilers state update resulted in a warning -# "Failed to determine CMake compilers state" after nasm was added as a language. - -# First dependency triggers initial compilers state update -sub_dep_1 = dependency('cmTest1') -# Add nasm as a language... if not add_languages('nasm', required: false, native: false) error('MESON_SKIP_TEST: nasm not found') endif -# ...and check for 2nd dependency. Together with cmake_skip_compiler_test = 'always', -# this triggers another CMake compilers state update, this time with nasm -# in the mix -sub_dep_2 = dependency('cmTest2') -exe1 = executable('exe1', ['main.c'], dependencies: [sub_dep_1, sub_dep_2]) +# Using this dependency triggers CMakeToolchain.update_cmake_compiler_state(), +# and with nasm as a language, resulted in a warning +# "Failed to determine CMake compilers state" after nasm was added as a language. +sub_dep = dependency('cmTest') + +exe1 = executable('exe1', ['main.c'], dependencies: [sub_dep]) test('test1', exe1) diff --git a/test cases/cmake/28 cmake nasm dependency/nativefile.ini.in b/test cases/cmake/28 cmake nasm dependency/nativefile.ini.in deleted file mode 100644 index ca40a3d76ace..000000000000 --- a/test cases/cmake/28 cmake nasm dependency/nativefile.ini.in +++ /dev/null @@ -1,2 +0,0 @@ -[properties] -cmake_skip_compiler_test = 'always' diff --git a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1.wrap b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest.wrap similarity index 63% rename from test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1.wrap rename to test cases/cmake/28 cmake nasm dependency/subprojects/cmTest.wrap index babfb6c07300..1ea202e45ca1 100644 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1.wrap +++ b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest.wrap @@ -2,4 +2,4 @@ method = cmake [provide] -cmTest1 = cmTest1_dep +cmTest = cmTest_dep diff --git a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2/CMakeLists.txt b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/CMakeLists.txt similarity index 91% rename from test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2/CMakeLists.txt rename to test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/CMakeLists.txt index 45a56cc5723a..d7677828b7b2 100644 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2/CMakeLists.txt +++ b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION}) -project(cmTest2) +project(cmTest) #Detect processor if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "[Aa][Mm][Dd]64") @@ -21,4 +21,4 @@ endif () enable_language(ASM_NASM) -add_library(cmTest2 STATIC cmTestAsm.asm) +add_library(cmTest STATIC cmTest.c cmTestAsm.asm) diff --git a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/cmTest.c b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/cmTest.c similarity index 100% rename from test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/cmTest.c rename to test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/cmTest.c diff --git a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2/cmTestAsm.asm b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/cmTestAsm.asm similarity index 100% rename from test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2/cmTestAsm.asm rename to test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/cmTestAsm.asm diff --git a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/CMakeLists.txt b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/CMakeLists.txt deleted file mode 100644 index 42f16f84e798..000000000000 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION ${CMAKE_VERSION}) - -project(cmTest1) - -add_library(cmTest1 STATIC cmTest.c) diff --git a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2.wrap b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2.wrap deleted file mode 100644 index a0ed381ae7a6..000000000000 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2.wrap +++ /dev/null @@ -1,5 +0,0 @@ -[wrap-file] -method = cmake - -[provide] -cmTest2 = cmTest2_dep