Use module for test

This commit is contained in:
LoveSy 2024-04-28 01:24:16 +08:00
parent 29f124c576
commit 11aa507da9
No known key found for this signature in database
3 changed files with 13 additions and 3 deletions

View File

@ -2,10 +2,18 @@ cmake_minimum_required(VERSION 3.18.1)
project("lsplant_test")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
add_subdirectory(external/lsparself)
add_library(test SHARED test.cpp)
find_package(dobby REQUIRED CONFIG)
find_package(lsplant REQUIRED CONFIG)
get_property(lsplant_INCLUDE TARGET lsplant::lsplant PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
file(GLOB_RECURSE lsplant_MODULES "${lsplant_INCLUDE}/*.ixx")
target_compile_features(lsplant::lsplant INTERFACE cxx_std_20)
target_sources(lsplant::lsplant INTERFACE FILE_SET CXX_MODULES BASE_DIRS ${lsplant_INCLUDE} FILES ${lsplant_MODULES})
set_target_properties(lsplant::lsplant PROPERTIES IMPORTED_CXX_MODULES_COMPILE_FEATURES "cxx_std_20")
set_target_properties(lsplant::lsplant PROPERTIES IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES "${lsplant_INCLUDE}")
target_link_libraries(test log dobby::dobby lsplant::lsplant lsparself)

@ -1 +1 @@
Subproject commit 28d6aca7ac8006f8d14d87bf76bed29e1c0d576f
Subproject commit 33db514471e1bd2f1cde13b3fdfcba32ee245b53

View File

@ -1,9 +1,11 @@
#include <jni.h>
#include <dobby.h>
#include <lsplant.hpp>
#include <sys/mman.h>
#include <lsparself.hpp>
#include "logging.h"
import lsplant;
#define _uintval(p) reinterpret_cast<uintptr_t>(p)
#define _ptr(p) reinterpret_cast<void *>(p)
#define _align_up(x, n) (((x) + ((n) - 1)) & ~((n) - 1))