From e9321bf565913b2d8c3a253f0b129f304379ce9f Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 6 Jul 2020 10:59:19 +0100 Subject: [PATCH] CMake: Fix demos which failed to build on Windows The PushNotificationsDemo is not supported on Windows, so I've stopped CMake from configuring it in the first place. --- examples/CMakeLists.txt | 5 ++++- examples/Utilities/PushNotificationsDemo.h | 2 +- extras/Build/CMake/JUCEUtils.cmake | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index f2e6edeb7e..fbbbbe78e0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -36,7 +36,10 @@ function(_juce_add_pips) "${CMAKE_CURRENT_SOURCE_DIR}/CameraDemo.h" "${CMAKE_CURRENT_SOURCE_DIR}/PushNotificationsDemo.h" "${CMAKE_CURRENT_SOURCE_DIR}/VideoDemo.h") - endif() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + list(REMOVE_ITEM headers + "${CMAKE_CURRENT_SOURCE_DIR}/PushNotificationsDemo.h") + endif() foreach(header IN ITEMS ${headers}) juce_add_pip(${header} added_target) diff --git a/examples/Utilities/PushNotificationsDemo.h b/examples/Utilities/PushNotificationsDemo.h index cf03cc18a1..ec8a4ae547 100644 --- a/examples/Utilities/PushNotificationsDemo.h +++ b/examples/Utilities/PushNotificationsDemo.h @@ -34,7 +34,7 @@ juce_audio_processors, juce_audio_utils, juce_core, juce_data_structures, juce_events, juce_graphics, juce_gui_basics, juce_gui_extra - exporters: xcode_mac, vs2019, xcode_iphone, androidstudio + exporters: xcode_mac, xcode_iphone, androidstudio moduleFlags: JUCE_STRICT_REFCOUNTEDPOINTER=1 JUCE_PUSH_NOTIFICATIONS=1 diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index bd014d16d3..859ae80f11 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -1961,6 +1961,11 @@ endfunction() function(juce_add_console_app target) add_executable(${target}) target_compile_definitions(${target} PRIVATE JUCE_STANDALONE_APPLICATION=1) + + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + target_compile_definitions(${target} PRIVATE _CONSOLE=1) + endif() + _juce_initialise_target(${target} ${ARGN}) endfunction()