修改头文件修复编译错误

This commit is contained in:
Nanako 2024-03-23 19:48:16 +08:00
parent 4746178a62
commit 83c7a1fc7d
16 changed files with 42 additions and 17 deletions

View File

@ -1,14 +1,15 @@
cmake_minimum_required(VERSION 3.5)
project(arona_core)
function(retrieve_files out_files)
function(retrieve_files path out_files)
set(source_list)
message(STATUS "Retrieving files in ${path}")
# .h .hpp. ini HEAD_FILES
file(GLOB_RECURSE HEAD_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS *.h *.hpp *.ini)
file(GLOB_RECURSE HEAD_FILES RELATIVE ${path} CONFIGURE_DEPENDS *.h *.hpp *.ini)
# *.cpp *.c SRC_FILES
file(GLOB_RECURSE SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS *.cpp *.c)
file(GLOB_RECURSE SRC_FILES RELATIVE ${path} CONFIGURE_DEPENDS *.cpp *.c *.ixx)
# HEDADER_FILES SRC_FILES ALL_FILES
set(ALL_FILES ${HEAD_FILES} ${SRC_FILES})
@ -45,7 +46,7 @@ function(retrieve_files out_files)
endif()
# Remove common directory prefix to make the group
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" GROUP "${PARENT_DIR}")
string(REPLACE "${path}" "" GROUP "${PARENT_DIR}")
# Make sure we are using windows slashes
string(REPLACE "/" "\\" GROUP "${GROUP}")
# Group into "Source Files" and "Header Files"

View File

@ -3,7 +3,7 @@ project(core)
set(CMAKE_CXX_STANDARD 23)
set(ALL_FILES "")
retrieve_files(ALL_FILES)
retrieve_files(${CMAKE_CURRENT_SOURCE_DIR} ALL_FILES)
add_library(${PROJECT_NAME} SHARED ${ALL_FILES})
@ -13,7 +13,6 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} rt
target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} rtaudio spdlog mempool Taskflow)
target_link_libraries(${PROJECT_NAME} PUBLIC rtaudio spdlog mempool Taskflow)
target_precompile_headers(${PROJECT_NAME} PUBLIC extern.h)
add_definitions(-Dcore_EXPORTS)
if (MSVC)

View File

@ -1,6 +1,8 @@
#pragma once
#include <memory>
#include <string>
#include "extern.h"
#include "spdlog/logger.h"
class renderer;
class render_target;

View File

@ -4,6 +4,7 @@
#include "audio/mixer/mixer_track.h"
#include "audio/plugin_host/midi_sequencer.h"
#include "audio/plugin_host/plugin_host_manager.h"
#include "spdlog/spdlog.h"
#include "thread_message/thread_message_hubs.h"
int rt_audio_callback(void *output_buffer, void *input_buffer,

View File

@ -1,4 +1,8 @@
#pragma once
#include <cstdint>
#include <mutex>
#include <vector>
#include "extern.h"
class CORE_API audio_buffer {
public:

View File

@ -4,6 +4,15 @@
#include <atomic>
#include "extern.h"
#include "spdlog/spdlog.h"
#if defined(_DEBUG) || defined(DEBUG)
#define checkf(expr, msg, ...) if (!(expr)) { spdlog::error(msg, __VA_ARGS__); throw std::runtime_error(fmt::format(msg, __VA_ARGS__)); }
#define check(expr) if (!(expr)) { spdlog::error("Check failed: {}", #expr); throw std::runtime_error(fmt::format("Check failed: {}", #expr)); }
#else
#define checkf(...)
#define check(...)
#endif
/**
* Basic implementation of a circular buffer built for pushing and popping arbitrary amounts of data at once.

View File

@ -1,5 +1,8 @@
#pragma once
#include <cstdint>
#include <map>
#include <string>
#include <vector>
class mixer_track;
class channel_node;

View File

@ -1,4 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
class mixer_track;
class channel_interface;

View File

@ -3,6 +3,7 @@
#include "misc/singleton/singleton.h"
#include <map>
#include <string>
class plugin_host;
class channel_interface;

View File

@ -1,4 +1,6 @@
#pragma once
#include <cstdint>
#include "misc/singleton/singleton.h"
class midi_sequencer : public singleton_t<midi_sequencer> {

View File

@ -1,4 +1,8 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "extern.h"
class mixer_track;
class channel_interface;

View File

@ -1,18 +1,7 @@
#pragma once
#include "spdlog/spdlog.h"
#ifdef core_EXPORTS
#define CORE_API __declspec(dllexport)
#else
#define CORE_API __declspec(dllimport)
#endif
#if defined(_DEBUG) || defined(DEBUG)
#define checkf(expr, msg, ...) if (!(expr)) { spdlog::error(msg, __VA_ARGS__); throw std::runtime_error(fmt::format(msg, __VA_ARGS__)); }
#define check(expr) if (!(expr)) { spdlog::error("Check failed: {}", #expr); throw std::runtime_error(fmt::format("Check failed: {}", #expr)); }
#else
#define checkf(...)
#define check(...)
#endif

View File

@ -85,6 +85,7 @@ Raw delegate payload: 10
#include <vector>
#include <memory>
#include <tuple>
#include "extern.h"
///////////////////////////////////////////////////////////////
//////////////////// DEFINES SECTION //////////////////////////

View File

@ -1,5 +1,7 @@
#include "singleton_manager.h"
#include <cstdint>
#include "singleton.h"
bool singleton_initliazer::has_init(singleton* s) {

View File

@ -1,4 +1,6 @@
#pragma once
#include <vector>
#include "extern.h"
class singleton;

View File

@ -1,4 +1,6 @@
#pragma once
#include <functional>
#include "extern.h"
class CORE_API thread_message {
public: