Skip to content

Commit

Permalink
format fixes. Dont run nanobind cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdonline committed Sep 27, 2023
1 parent d34c5ba commit fdc16d0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ endif()
if(NRN_ENABLE_PYTHON)
# Make sure the USE_PYTHON macro is defined in the C++ code
list(APPEND NRN_COMPILE_DEFS USE_PYTHON)
# Activate nanobind
nrn_add_external_project(nanobind)
# Ensure nanobind is there, but dont import, we don't want its CMake
nrn_add_external_project(nanobind, False)
endif()

# =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion cmake/ExternalProjectHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(nrn_initialize_submodule path)
endif()
message(STATUS "Sub-module : missing ${path} : running git submodule update --init")
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init -- ${path}
COMMAND ${GIT_EXECUTABLE} submodule update --recursive --init -- ${path}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE ret)
if(NOT ret EQUAL 0)
Expand Down
18 changes: 9 additions & 9 deletions src/nrnpython/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ install(TARGETS rxdmath DESTINATION ${NRN_INSTALL_SHARE_LIB_DIR})
# minimal nanobind interface
# =============================================================================
add_library(nanobind INTERFACE)
target_sources(nanobind INTERFACE
${NB_DIR}/src/common.cpp
${NB_DIR}/src/error.cpp
${NB_DIR}/src/nb_internals.cpp
${NB_DIR}/src/nb_static_property.cpp
${NB_DIR}/src/nb_type.cpp
${NB_DIR}/src/nb_func.cpp
${NB_DIR}/src/implicit.cpp
)
target_sources(
nanobind
INTERFACE ${NB_DIR}/src/common.cpp
${NB_DIR}/src/error.cpp
${NB_DIR}/src/nb_internals.cpp
${NB_DIR}/src/nb_static_property.cpp
${NB_DIR}/src/nb_type.cpp
${NB_DIR}/src/nb_func.cpp
${NB_DIR}/src/implicit.cpp)
target_include_directories(nanobind INTERFACE "${NB_DIR}/include" "${NB_DIR}/ext/robin_map/include")

# =============================================================================
Expand Down
4 changes: 2 additions & 2 deletions src/nrnpython/nrnpy_hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ static IvocVect* nrnpy_vec_from_python(void* v) {
hoc_execerror(hoc_object_name(ho),
" does not support the Python Sequence or Iterator protocol");
}
for(nb::handle item : po) {
for (nb::handle item: po) {
if (!PyNumber_Check(item.ptr())) {
char buf[50];
Sprintf(buf, "Some list items are not a number");
Expand All @@ -2423,7 +2423,7 @@ static IvocVect* nrnpy_vec_from_python(void* v) {
x[i] = *(double*) (y + j);
}
} else {
for (long i=0; i<size; i++) {
for (long i = 0; i < size; ++i) {
auto item = po[i];
if (!PyNumber_Check(item.ptr())) {
char buf[50];
Expand Down

0 comments on commit fdc16d0

Please sign in to comment.