Browse Source

CMake: avoid /W3 overriding warnings and enable -DUNICODE on Windows.

Consistent with how all other Magnum projects do it.
appveyor-coverage
Vladimír Vondruš 7 years ago
parent
commit
c536caaf13
  1. 11
      src/CMakeLists.txt

11
src/CMakeLists.txt

@ -23,6 +23,17 @@
# DEALINGS IN THE SOFTWARE.
#
# On MSVC remove /W3, as we are replacing it with /W4
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
# On Windows enable UNICODE/_UNICODE macros to avoid accidentally passing UTF-8
# values to ANSI functions
if(CORRADE_TARGET_WINDOWS)
add_definitions("-DUNICODE" "-D_UNICODE")
endif()
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
add_subdirectory(Corrade)

Loading…
Cancel
Save