[DO-981] qt package (!15)

Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech>
Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15
This commit is contained in:
Aleksandr Vodyanov
2025-02-13 12:25:48 +03:00
parent 60445ac09e
commit 3759e1163f
228 changed files with 16106 additions and 12 deletions

View File

@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES C)
find_package(md4c CONFIG REQUIRED)
add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(test_package PRIVATE md4c::md4c)

View File

@@ -0,0 +1,10 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json",
"build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json"
]
}

View File

@@ -0,0 +1,26 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake
import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"
def requirements(self):
self.requires(self.tested_reference_str)
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")

View File

@@ -0,0 +1,57 @@
#include "md4c.h"
#include <stdio.h>
#include <string.h>
int enter_block(MD_BLOCKTYPE type, void* detail, void* userdata) {
printf("enter block\n");
return 0;
}
int leave_block(MD_BLOCKTYPE type, void* detail, void* userdata) {
printf("leave block\n");
return 0;
}
int enter_span(MD_SPANTYPE type, void* detail, void* userdata) {
printf("enter span\n");
return 0;
}
int leave_span(MD_SPANTYPE type, void* detail, void* userdata) {
printf("leave span\n");
return 0;
}
int text_block(MD_TEXTTYPE type, const MD_CHAR* text, MD_SIZE size, void* usrdata) {
printf("text block\n");
return 0;
}
int main() {
const char DATA[] =
"# title\n"
"\n"
"example1\n"
"`example2`\n"
"\n"
"> example3\n"
"\n"
;
printf("%s\n", DATA);
MD_PARSER parser;
parser.abi_version = 0;
parser.flags = MD_FLAG_TABLES;
parser.enter_block = enter_block;
parser.leave_block = leave_block;
parser.enter_span = enter_span;
parser.leave_span = leave_span;
parser.text = text_block;
md_parse(DATA, strlen(DATA), &parser, NULL);
return 0;
}