add tomlpp
This commit is contained in:
parent
507e0c88a8
commit
f71cfbdfe9
|
@ -0,0 +1,3 @@
|
|||
[submodule "third_party/tomlplusplus"]
|
||||
path = third_party/tomlplusplus
|
||||
url = https://github.com/marzer/tomlplusplus
|
|
@ -10,10 +10,13 @@ include(Policies)
|
|||
include(ProjectFuncs)
|
||||
include(CompilerFlags)
|
||||
|
||||
add_subdirectory(third_party/tomlplusplus)
|
||||
|
||||
add_executable(nanosm
|
||||
src/main.cpp
|
||||
|
||||
src/tomlpp_src.cpp
|
||||
|
||||
# glue code
|
||||
src/EventLoop.cpp
|
||||
src/Timer.cpp
|
||||
|
@ -21,6 +24,14 @@ add_executable(nanosm
|
|||
src/Process.cpp
|
||||
)
|
||||
|
||||
target_compile_definitions(nanosm PRIVATE
|
||||
-DTOML_HEADER_ONLY=0
|
||||
)
|
||||
|
||||
target_link_libraries(nanosm PRIVATE
|
||||
tomlplusplus::tomlplusplus
|
||||
)
|
||||
|
||||
nanosm_target(nanosm)
|
||||
|
||||
# todo: cmake install sex
|
||||
|
|
|
@ -58,10 +58,10 @@ set(CMAKE_CXX_FLAGS "${NANOSM_CORE_COMPILE_ARGS}")
|
|||
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -O0 -g3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -O3 -g3")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -s")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g3")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -O3 -g3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -s")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${NANOSM_CORE_LINKER_ARGS} -Wl,-z,noexecstack,-z,relro,-z,now")
|
||||
|
|
|
@ -23,12 +23,12 @@ void test() {
|
|||
printf("exited with %d exitcode\n", exitCode);
|
||||
|
||||
timer->SetExpiryCallback([pp = p]() {
|
||||
printf("5s elapsed, restarting Nowr\n");
|
||||
printf("Timer elapsed, restarting Nowr\n");
|
||||
pp->Respawn();
|
||||
});
|
||||
|
||||
// Start the timer to wait a bit before restarting the process
|
||||
timer->Arm(5);
|
||||
timer->Arm(1);
|
||||
});
|
||||
|
||||
ev.AddObject(timer);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 89406c77e6480c212b17e0ce7939f9ee833e909d
|
Loading…
Reference in New Issue