Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pd external now building correctly on Windows, CMake sets CXX standard #55

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}