From 7d4672a7faed30ecf0031e7d5e0040f954b4b925 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/{cmTest2.wrap => cmTest.wrap} | 2 +- .../{cmTest2 => cmTest}/CMakeLists.txt | 4 ++-- .../subprojects/{cmTest1 => cmTest}/cmTest.c | 2 +- .../{cmTest2 => cmTest}/cmTestAsm.asm | 0 .../subprojects/cmTest1.wrap | 5 ----- .../subprojects/cmTest1/CMakeLists.txt | 5 ----- 8 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 test cases/cmake/28 cmake nasm dependency/nativefile.ini.in rename test cases/cmake/28 cmake nasm dependency/subprojects/{cmTest2.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 (73%) 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.wrap delete mode 100644 test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/CMakeLists.txt 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/cmTest2.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/cmTest2.wrap rename to test cases/cmake/28 cmake nasm dependency/subprojects/cmTest.wrap index a0ed381ae7a6..1ea202e45ca1 100644 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest2.wrap +++ b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest.wrap @@ -2,4 +2,4 @@ method = cmake [provide] -cmTest2 = cmTest2_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 73% 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 index e32415c94c9f..94be36ad707d 100644 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1/cmTest.c +++ b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest/cmTest.c @@ -4,5 +4,5 @@ extern const int32_t cmTestArea; int32_t cmTestFunc(void) { - return cmTestArea; + return 4242/*cmTestArea*/; } 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.wrap b/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1.wrap deleted file mode 100644 index babfb6c07300..000000000000 --- a/test cases/cmake/28 cmake nasm dependency/subprojects/cmTest1.wrap +++ /dev/null @@ -1,5 +0,0 @@ -[wrap-file] -method = cmake - -[provide] -cmTest1 = cmTest1_dep 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)