[DO-978] openssl package (!8)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/8
This commit is contained in:
30
recipes/nasm/all/test_package/conanfile.py
Normal file
30
recipes/nasm/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import cmake_layout
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "VirtualBuildEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def build_requirements(self):
|
||||
self.tool_requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def test(self):
|
||||
self.run("nasm --version")
|
||||
asm_file = os.path.join(self.source_folder, "hello_linux.asm")
|
||||
out_file = os.path.join(self.build_folder, "hello_linux.o")
|
||||
self.run(f"nasm -felf64 {asm_file} -o {out_file}")
|
||||
if can_run(self):
|
||||
if self.settings.os == "Linux" and self.settings.arch == "x86_64":
|
||||
# TODO was tools.get_env, what should it be?
|
||||
ld = os.getenv("LD", "ld")
|
||||
bin_file = os.path.join(self.build_folder, "hello_linux")
|
||||
self.run(f"{ld} hello_linux.o -o {bin_file}")
|
||||
self.run(bin_file)
|
||||
16
recipes/nasm/all/test_package/hello_linux.asm
Normal file
16
recipes/nasm/all/test_package/hello_linux.asm
Normal file
@@ -0,0 +1,16 @@
|
||||
; Print "Hello, Conan"
|
||||
|
||||
global _start
|
||||
|
||||
section .text
|
||||
_start: mov rax, 1 ; system call for write
|
||||
mov rdi, 1 ; file handle 1 is stdout
|
||||
mov rsi, message ; address of string to output
|
||||
mov rdx, 13 ; number of bytes
|
||||
syscall ; invoke operating system to do the write
|
||||
mov rax, 60 ; system call for exit
|
||||
xor rdi, rdi ; exit code 0
|
||||
syscall ; invoke operating system to exit
|
||||
|
||||
section .data
|
||||
message: db "Hello, Conan", 10 ; note the newline at the end
|
||||
Reference in New Issue
Block a user