From 4a422dffaa8cbf4af2ccf8f126bc15d07bdca710 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 27 Jan 2017 00:56:38 -0800 Subject: [PATCH 1/3] CMake: CMAKE_SIZEOF_VOID_P must be 8 for an x86_64 build This is an issue because CMAKE_SYSTEM_PROCESSOR is defined as the host processor when not cross-compiling, and building for Win32 doesn't count as cross-compiling. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b56f9a4ea..c6f4b81a10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,7 +166,7 @@ if(ENABLE_GENERIC) message(STATUS "Warning! Building generic build!") set(_M_GENERIC 1) add_definitions(-D_M_GENERIC=1) -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") +elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") set(_M_X86 1) set(_M_X86_64 1) add_definitions(-D_M_X86=1) @@ -180,7 +180,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") # CRC instruction set is used in the CRC32 hash function check_and_add_flag(HAVE_ARCH_ARMV8 -march=armv8-a+crc) else() - message(FATAL_ERROR "You're building on an unsupported platform '${CMAKE_SYSTEM_PROCESSOR}'. Enable generic build if you really want a JIT-less binary.") + message(FATAL_ERROR "You're building on an unsupported platform: " + "'${CMAKE_SYSTEM_PROCESSOR}' with ${CMAKE_SIZEOF_VOID_P}-byte pointers." + " Enable generic build if you really want a JIT-less binary.") endif() From 0475a85195bfecb1dd3bae551f8f98ea88034ee7 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 27 Jan 2017 00:58:21 -0800 Subject: [PATCH 2/3] CMake: Move Windows defines to Source/CMakeLists.txt Messes up various Externals, like PortAudio. --- CMakeLists.txt | 11 +---------- Source/CMakeLists.txt | 11 +++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6f4b81a10..0ac82623d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9d886827f4..e1836da317 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -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) From 497173f66541842aa4719d67d49e0b8326454edb Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 27 Jan 2017 01:32:23 -0800 Subject: [PATCH 3/3] CMake: Disable PortAudio support for ASIO, DS, and WDMKS Fixes a link-time error, and matches what the vcxproj does. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ac82623d4..628f877e98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -568,6 +568,9 @@ if(NOT ANDROID) set(PORTAUDIO_LIBRARIES portaudio) else() message(STATUS "Using static PortAudio from Externals for mic support") + option(PA_USE_ASIO "Enable PortAudio support for ASIO" OFF) + option(PA_USE_DS "Enable PortAudio support for DirectSound" OFF) + option(PA_USE_WDMKS "Enable PortAudio support for WDMKS" OFF) add_subdirectory(Externals/portaudio) set(PORTAUDIO_LIBRARIES portaudio_static) endif()