Skip to content

Commit

Permalink
Fix error reporting from generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
jougs committed Jun 22, 2023
1 parent 0d50fbc commit 82381f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build_support/generate_modelsmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def get_models_from_file(model_file):

fname = Path(srcdir) / "models" / f"{model_file}.h"
if not os.path.exists(fname):
print(f"ERROR: Model with name {model_file}.h does not exist")
sys.exit()
print(f"ERROR: Model with name {model_file}.h does not exist", file=sys.stderr)
sys.exit(128)

guards = []
names = []
Expand Down
8 changes: 6 additions & 2 deletions cmake/ProcessOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ function( NEST_PROCESS_WITH_HDF5 )
set( HDF5_VERSION "${HDF5_VERSION}" PARENT_SCOPE )
set( HDF5_HL_LIBRARIES "${HDF5_HL_LIBRARIES}" PARENT_SCOPE )
set( HDF5_DEFINITIONS "${HDF5_DEFINITIONS}" PARENT_SCOPE )

include_directories( ${HDF5_INCLUDE_DIRS} )

endif ()
Expand Down Expand Up @@ -657,9 +657,13 @@ function( NEST_PROCESS_MODELS )
"${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" "${BUILTIN_MODELS}"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
OUTPUT_VARIABLE MODELS_SOURCES
COMMAND_ERROR_IS_FATAL ANY
ERROR_VARIABLE MODELS_SOURCES_ERROR
)

if ( MODELS_SOURCES_ERROR )
printError( ${MODELS_SOURCES_ERROR} )
endif()

set( BUILTIN_MODELS ${BUILTIN_MODELS} PARENT_SCOPE )
set( MODELS_SOURCES_GENERATED ${MODELS_SOURCES} PARENT_SCOPE )
endfunction()
Expand Down

0 comments on commit 82381f2

Please sign in to comment.