Initial commit
This commit is contained in:
14
mimalloc/all/test_package/CMakeLists.txt
Normal file
14
mimalloc/all/test_package/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package LANGUAGES C)
|
||||
|
||||
find_package(mimalloc REQUIRED CONFIG)
|
||||
|
||||
find_program(MINJECT_EXECUTABLE NAMES minject)
|
||||
execute_process(COMMAND ${MINJECT_EXECUTABLE} -h)
|
||||
|
||||
find_program(MINJECT32_EXECUTABLE NAMES minject32)
|
||||
execute_process(COMMAND ${MINJECT32_EXECUTABLE} -h)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.c)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE $<IF:$<TARGET_EXISTS:mimalloc>,mimalloc,mimalloc-static>)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE c_std_99)
|
||||
28
mimalloc/all/test_package/conanfile.py
Normal file
28
mimalloc/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import CMake, cmake_layout
|
||||
import os
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def configure(self):
|
||||
self.options["mimalloc"].shared = True
|
||||
|
||||
def test(self):
|
||||
if can_run(self):
|
||||
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
|
||||
self.run(bin_path, env="conanrun")
|
||||
14
mimalloc/all/test_package/test_package.c
Normal file
14
mimalloc/all/test_package/test_package.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "mimalloc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
void *data = mi_malloc(32);
|
||||
|
||||
printf("mimalloc version %d\n", mi_version());
|
||||
|
||||
mi_free(data);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user