Skip to content

Commit

Permalink
set CXX standard for Windows in cmake list, set linker attribute for …
Browse files Browse the repository at this point in the history
…Pd external (solves issue #53)
  • Loading branch information
francescobigoni committed Jun 22, 2023
1 parent 676f60e commit 55a531c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ git clone https://github.com/acids-ircam/nn_tilde --recurse-submodules
cd nn_tilde
mkdir build
cd build
cmake ..\src -A x64 -DCMAKE_PREFIX_PATH="<unzipped libtorch directory>"
cmake ..\src -A x64 -DCMAKE_PREFIX_PATH="<unzipped libtorch directory>" -DPUREDATA_INCLUDE_DIR="<path-to-pd/src>" -DPUREDATA_BIN_DIR="<path-to-pd/bin>"
cmake --build . --config Release
```

Expand Down
1 change: 1 addition & 0 deletions src/frontend/maxmsp/nn_tilde/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ endif()
endif()

if (MSVC) # COPY TORCH DLL IN THE LOADER FOLDER
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${TORCH_INSTALL_PREFIX}/lib/" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/
)
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/puredata/nn_tilde/nn_tilde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ void startup_message() {
}

extern "C" {
#ifdef _WIN32
void __declspec(dllexport) nn_tilde_setup(void) {
#else
void nn_tilde_setup(void) {
#endif
startup_message();
nn_tilde_class = class_new(gensym("nn~"), (t_newmethod)nn_tilde_new, 0,
sizeof(t_nn_tilde), CLASS_DEFAULT, A_GIMME, 0);
Expand All @@ -288,4 +292,4 @@ void nn_tilde_setup(void) {
A_GIMME, A_NULL);
CLASS_MAINSIGNALIN(nn_tilde_class, t_nn_tilde, f);
}
}
}

0 comments on commit 55a531c

Please sign in to comment.