Commit bd664d9a authored by Aziz Baibabaev's avatar Aziz Baibabaev

Replace add_definitions with CMAKE_CXX_FLAGS in cmake file

When using add_definitions erroneous flags are passed to dll resource compiler under MinGW. This breaks the build for anything linked to dlib, using a dll rc and MinGW.

The proper way is to append to CMAKE_CXX_FLAGS.

For CMake 2.8.12 and higher the proper way is add_compile_options(-Wreturn-type) OR target_compile_options(dlib PRIVATE -Wreturn-type)
parent 95887df0
......@@ -16,7 +16,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
# By default, g++ won't warn or error if you forget to return a value in a
# function which requires you to do so. This option makes it give a warning
# for doing this.
add_definitions("-Wreturn-type")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wreturn-type")
endif()
# Setup some options to allow a user to enable SSE and AVX instruction use.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment