Skip to content

Commit

Permalink
Merge 2514515 into 5808ef9
Browse files Browse the repository at this point in the history
  • Loading branch information
imciner2 committed Sep 30, 2021
2 parents 5808ef9 + 2514515 commit daa5799
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ endif (NOT MSVC)
# numeric types
if(DFLOAT)
set(QDLDL_FLOAT_TYPE "float")
set(QDLDL_DFLOAT 1)
else()
set(QDLDL_FLOAT_TYPE "double")
endif()

if(DLONG)
set(QDLDL_INT_TYPE "long long")
set(QDLDL_INT_TYPE_MAX "LLONG_MAX")
set(QDLDL_DLONG 1)
else()
set(QDLDL_INT_TYPE "int")
set(QDLDL_INT_TYPE_MAX "INT_MAX")
Expand All @@ -78,6 +80,8 @@ endif()
#problems when calling QDLDL from C++
set(QDLDL_BOOL_TYPE "unsigned char")

# Generate header file with the global options
# ---------------------------------------------
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/qdldl_types.h.in
${CMAKE_CURRENT_SOURCE_DIR}/include/qdldl_types.h
NEWLINE_STYLE LF)
Expand Down
10 changes: 10 additions & 0 deletions configure/qdldl_types.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ typedef @QDLDL_BOOL_TYPE@ QDLDL_bool; /* for boolean values */
//Maximum value of the signed type QDLDL_int.
#define QDLDL_INT_MAX @QDLDL_INT_TYPE_MAX@

/*
* Configuration options
*/

/* When defined, QDLDL is using floats instead of doubles */
#cmakedefine QDLDL_DFLOAT

/* When defined, QDLDL is using long long instead of int types */
#cmakedefine QDLDL_DLONG

# ifdef __cplusplus
}
# endif /* ifdef __cplusplus */
Expand Down

0 comments on commit daa5799

Please sign in to comment.