Skip to content

Commit

Permalink
Simplify 'cmake nasm dependency' test case
Browse files Browse the repository at this point in the history
  • Loading branch information
res2k committed Nov 21, 2024
1 parent 089bc37 commit 7d4672a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 28 deletions.
18 changes: 6 additions & 12 deletions test cases/cmake/28 cmake nasm dependency/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 0 additions & 2 deletions test cases/cmake/28 cmake nasm dependency/nativefile.ini.in

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
method = cmake

[provide]
cmTest2 = cmTest2_dep
cmTest = cmTest_dep
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -21,4 +21,4 @@ endif ()

enable_language(ASM_NASM)

add_library(cmTest2 STATIC cmTestAsm.asm)
add_library(cmTest STATIC cmTest.c cmTestAsm.asm)
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ extern const int32_t cmTestArea;

int32_t cmTestFunc(void)
{
return cmTestArea;
return 4242/*cmTestArea*/;
}

This file was deleted.

This file was deleted.

0 comments on commit 7d4672a

Please sign in to comment.