调整C++ 代码

This commit is contained in:
2024-05-28 19:32:20 +08:00
parent de31b79465
commit 1ee0ec29b7
13 changed files with 62 additions and 23 deletions

View File

@@ -20,7 +20,10 @@ ELSE()
ENDIF()
# 添加共享库
add_library(${PROJECT_NAME} ${STATIC_OR_SHARED} library.cpp)
add_library(${PROJECT_NAME} ${STATIC_OR_SHARED}
Calculate.cpp
CalculateInfo.h
)
# 解析配置
if(EX_PLATFORM EQUAL 32)

View File

@@ -1,4 +1,4 @@
#include "library.h"
#include "Calculate.h"
#include <iostream>

View File

@@ -2,12 +2,7 @@
#define CPPLIB_LIBRARY_H
#include <string>
struct CalculateInfo {
std::string name;
std::string versionName;
int versionCode;
};
#include "CalculateInfo.h"
class Calculate {
public:

17
cppLib/CalculateInfo.h Normal file
View File

@@ -0,0 +1,17 @@
//
// Created on 2024/5/28.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".
#ifndef HM4DEMO_CALCULATEINFO_H
#define HM4DEMO_CALCULATEINFO_H
#include <string>
struct CalculateInfo {
std::string name;
std::string versionName;
int versionCode;
};
#endif //HM4DEMO_CALCULATEINFO_H

Binary file not shown.