mirror of https://github.com/davisking/dlib.git
Changed CMake so it doesn't automatically enable asserts in debug builds since
this frustrates Visual Studio users who want to compile dlib as a static library.
This commit is contained in:
parent
bf94ce6f4e
commit
cccde6324c
|
@ -33,12 +33,18 @@ endif()
|
||||||
include(cmake_utils/add_global_compiler_switch.cmake)
|
include(cmake_utils/add_global_compiler_switch.cmake)
|
||||||
|
|
||||||
|
|
||||||
# Make sure ENABLE_ASSERTS is defined for debug builds
|
if (DLIB_IN_PROJECT_BUILD)
|
||||||
if (NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-DENABLE_ASSERTS")
|
# Make sure ENABLE_ASSERTS is defined for debug builds, but only for uses
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLE_ASSERTS"
|
# who are building an application. If they are just building dlib as a
|
||||||
CACHE STRING "Flags used by the compiler during C++ debug builds."
|
# stand alone library then don't set this because it will conflict with the
|
||||||
FORCE)
|
# settings in config.h if we did.
|
||||||
endif ()
|
if (NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-DENABLE_ASSERTS")
|
||||||
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLE_ASSERTS"
|
||||||
|
CACHE STRING "Flags used by the compiler during C++ debug builds."
|
||||||
|
FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
macro (toggle_preprocessor_switch option_name)
|
macro (toggle_preprocessor_switch option_name)
|
||||||
if (${option_name})
|
if (${option_name})
|
||||||
add_global_define(${option_name})
|
add_global_define(${option_name})
|
||||||
|
|
Loading…
Reference in New Issue