Skip to content

Commit

Permalink
CMake: Move Windows defines to Source/CMakeLists.txt
Browse files Browse the repository at this point in the history
Messes up various Externals, like PortAudio.
  • Loading branch information
ligfx committed Jan 27, 2017
1 parent 4a422df commit 0475a85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 1 addition & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,7 @@ else()
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_WIN32_WINNT=0x0602)
add_definitions(-D_SECURE_SCL=0)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
# This doesn't play well with the packaging script that doesn't understand @rpath
set(CMAKE_MACOSX_RPATH OFF)

Expand Down
11 changes: 11 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ if(NOT FLAG_CXX_CXX14)
check_and_add_flag(HAS_CXX1Y -std=c++1y)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_WIN32_WINNT=0x0602)
add_definitions(-D_SECURE_SCL=0)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif()

# These aren't actually needed for C11/C++11
# but some dependencies require them (LLVM, libav).
add_definitions(-D__STDC_LIMIT_MACROS)
Expand Down

0 comments on commit 0475a85

Please sign in to comment.