Skip to content

Commit

Permalink
update object
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesneimog committed Nov 24, 2024
1 parent 0f37c2d commit 43fb88b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
33 changes: 12 additions & 21 deletions Resources/Pd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,35 @@ set(PDCMAKE_DIR
CACHE PATH "Path to pd.cmake")

include(${PDCMAKE_DIR}/pd.cmake)

# Add cpp-httplib as a subdirectory, but exclude it from the default build
add_subdirectory(cpp-httplib EXCLUDE_FROM_ALL)

# Set C++ standard to C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Ensure static linking of the C++ runtime library

# Define the main target
pd_add_external(pd4web pd4web.cpp LINK_LIBRARIES httplib)
set_target_properties(
pd4web
PROPERTIES CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MT")

# Adicionar as opções de compilação para os alvos específicos
foreach(target pd4web)
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/MT")
endforeach()
endif()

# Add data files associated with the pd4web target
pd_add_datafile(pd4web pd4web-help.pd)
pd_add_datafile(pd4web README.deken.pd)
pd_add_datafile(pd4web pd4web.cpp)

file(GLOB PROJECT_FILES "Projects/*.pd")
set(COUNT 1)

foreach(file ${PROJECT_FILES})
get_filename_component(file_name ${file} NAME)
pd_add_datafile(pd4web "Projects/${file_name}")
endforeach(file ${PROJECT_FILES})

pd_add_datafile(pd4web README.deken.pd)

set_target_properties(
pd4web
PROPERTIES CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)
string(REGEX REPLACE "\\.[^.]*$" "" project_folder ${file_name})
pd_add_datafile(pd4web "Projects/${file_name}" DESTINATION "Examples/${COUNT}-${project_folder}")
math(EXPR COUNT "${COUNT}+1")
endforeach(file ${PROJECT_FILES})
4 changes: 2 additions & 2 deletions Resources/Pd/pd4web-help.pd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#N canvas 544 72 339 371 12;
#N canvas 544 72 668 761 12;
#N canvas 557 272 499 366 patch 0;
#X obj 10 112 nbx 5 14 8 2048 0 1 r-memory s-memory empty 0 -10 0 8 #ffffff #000000 #000000 32 256;
#X obj 52 245 bng 25 250 50 0 s-compile r-compile empty -15 -10 0 12 #ffc7c6 #ff0400 #000000;
Expand Down Expand Up @@ -222,7 +222,7 @@
#X coords 0 1 100 -1 297 21 1;
#X restore 8 158 graph;
#X obj 35 32 cnv 5 5 5 empty empty Charles\ K.\ Neimog\ |\ charlesneimog.github.io/pd4web 0 0 0 8 #dfdfdf #000000 0;
#N canvas 517 246 426 426 extra 1;
#N canvas 517 246 426 426 extra 0;
#X obj 7 76 tgl 15 1 s-gui r-gui empty 0 -10 0 12 #fcfcfc #000000 #000000 1 1;
#X obj 55 78 cnv 5 240 10 empty empty On/Off\ -\ Render\ the\ Gui. 2 5 0 8 #feffc6 #000000 0;
#N canvas 0 50 450 250 (subpatch) 0;
Expand Down
2 changes: 0 additions & 2 deletions Resources/Pd/pd4web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class Pd4Web {
static bool pd4web_terminal(Pd4Web *x, std::string cmd, bool detached = false,
bool sucessMsg = false, bool showMessage = false,
bool clearNewline = false) {

post("[pd4web] Running command: %s", cmd.c_str());

if (x->running) {
pd_error(x, "[pd4web] Another command is running.");
Expand Down

0 comments on commit 43fb88b

Please sign in to comment.