+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
+
+ ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions.
+ ADD_COMPILE_OPTIONS( /vmg ) # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
+ ADD_COMPILE_OPTIONS( /wd4251 ) # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'"
+
+ELSEIF( UNIX )
+
+ # Set up compiler flags and warnings
+ ADD_COMPILE_OPTIONS( -std=c++11 )
+ ADD_COMPILE_OPTIONS( -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast )
+
+ # TODO: Clang is a lot more strict with warnings, we should address
+ # those issues at some point.
+ IF( NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
+ ADD_COMPILE_OPTIONS( -Werror )
+ ENDIF()
+
+ ADD_COMPILE_OPTIONS( -Wall -Wextra -Wno-unused-parameter -Wfloat-equal -Wno-class-memaccess -Wno-cast-function-type )
+
+ IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
+ ADD_COMPILE_OPTIONS( --coverage )
+ SET(ENABLE_COVERAGE ON)
+ SET(COVERAGE --coverage)
+ ENDIF()
+
+ IF( NOT ${ENABLE_EXPORTALL} )
+ ADD_COMPILE_OPTIONS( "-fvisibility=hidden" )
+ ENDIF()
+
+ENDIF()