Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f5af8d

Browse files
committed
organize code - include / src
1 parent1d33719 commit2f5af8d

File tree

15 files changed

+45
-36
lines changed

15 files changed

+45
-36
lines changed

‎CMakeLists.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,35 @@ elseif(NOT CMAKE_CXX_STANDARD)
2626
set(CMAKE_CXX_STANDARD_REQUIREDON)
2727
endif()
2828

29-
# Library sources.
30-
add_subdirectory(lib)
29+
set(ACTO_PUBLIC_INCLUDE_DIR"include/acto")
30+
31+
add_library(acto-libSTATIC)
32+
33+
target_sources(acto-lib
34+
PUBLIC
35+
"include/acto/acto.h"
36+
"include/acto/event.h"
37+
"include/acto/generics.h"
38+
PRIVATE
39+
"src/acto.cpp"
40+
"src/event.cpp"
41+
"src/runtime.cpp"
42+
"src/runtime.h"
43+
"src/worker.cpp"
44+
"src/worker.h"
45+
)
46+
47+
target_include_directories(acto-lib
48+
PUBLIC
49+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
50+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
51+
)
52+
53+
if(UNIX)
54+
target_link_libraries(acto-libPUBLIC
55+
pthread
56+
)
57+
endif()
3158

3259
# Build samples.
3360
if(ACTO_BUILD_SAMPLES)
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎lib/CMakeLists.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎samples/cycles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
// Для использование библиотеки достаточно подключить
2020
// только один этот файл
21-
#include<acto.h>
21+
#include<acto/acto.h>
2222

2323
#ifdef ACTO_WIN
2424
#include<conio.h>

‎samples/ping-pong.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// Для использование библиотеки достаточно подключить
2222
// только один этот файл
23-
#include<acto.h>
23+
#include<acto/acto.h>
2424

2525
#include<cstdio>
2626
#include<cstdlib>

‎lib/acto.cpprenamed to ‎src/acto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include"acto.h"
1+
#include"acto/acto.h"
22
#include"runtime.h"
33

44
namespaceacto {

‎lib/event.cpprenamed to ‎src/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include"event.h"
1+
#include"acto/event.h"
22

33
namespaceacto {
44
namespacecore {

‎lib/runtime.cpprenamed to ‎src/runtime.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include"runtime.h"
2-
#include"generics.h"
2+
#include"acto/generics.h"
33
#include"worker.h"
44

55
namespaceacto {
@@ -156,10 +156,6 @@ void runtime_t::deconstruct_object(object_t* const obj) {
156156

157157
constbool is_binded = obj->binded;
158158

159-
// There are no more references to the object,
160-
// so delete it.
161-
delete obj;
162-
163159
// Remove object from the global registry.
164160
if (!is_binded) {
165161
std::lock_guard<std::mutex>g(mutex_);
@@ -170,6 +166,10 @@ void runtime_t::deconstruct_object(object_t* const obj) {
170166
no_actors_event_.signaled();
171167
}
172168
}
169+
170+
// There are no more references to the object,
171+
// so delete it.
172+
delete obj;
173173
}
174174

175175
voidruntime_t::handle_message(object_t* obj, std::unique_ptr<msg_t> msg) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp