File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ function(add_example_or_test TARGET_NAME ...)
8181 endif ()
8282endfunction ()
8383
84+
8485option (HNSWLIB_ENABLE_EXCEPTIONS "Whether to enable exceptions in hnswlib" ON )
8586if (HNSWLIB_ENABLE_EXCEPTIONS)
8687 message ("Exceptions are enabled using HNSWLIB_ENABLE_EXCEPTIONS=ON (default)" )
@@ -126,12 +127,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
126127 # Turn on assertions in the RelWithDebInfo build type.
127128 string (REPLACE "/D NDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
128129 "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} " )
130+ string (REPLACE "/D NDEBUG" "" CMAKE_CXX_FLAGS
131+ "${CMAKE_CXX_FLAGS} " )
129132else ()
130133 set (ENABLE_EXCEPTIONS_FLAGS -fexceptions)
131134 set (DISABLE_EXCEPTIONS_FLAGS -fno-exceptions)
132135 # Turn on assertions in the RelWithDebInfo build type.
133136 string (REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
134137 "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} " )
138+ string (REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS
139+ "${CMAKE_CXX_FLAGS} " )
135140endif ()
136141set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_NEW} "
137142 CACHE STRING "Flags for RelWithDebInfo configuration." FORCE)
@@ -171,6 +176,7 @@ if(HNSWLIB_EXAMPLES)
171176 set (${FLAGS_VAR} "${${FLAGS_VAR} }" CACHE STRING
172177 "Flags for ${config} configuration." FORCE)
173178 endforeach ()
179+ string (REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " )
174180 endif ()
175181 add_cxx_flags(/O2 /W1 /openmp)
176182 endif ()
You can’t perform that action at this time.
0 commit comments