Browse Source

Fixed some Projucer live-build errors on Windows and added an option to set the Windows target platform

tags/2021-05-28
ed 8 years ago
parent
commit
fa0b097652
5 changed files with 30 additions and 11 deletions
  1. +21
    -10
      extras/Projucer/Source/LiveBuildEngine/projucer_CompileEngineClient.cpp
  2. +3
    -0
      extras/Projucer/Source/LiveBuildEngine/projucer_ProjectBuildInfo.h
  3. +1
    -0
      extras/Projucer/Source/Utility/jucer_PresetIDs.h
  4. +1
    -1
      modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h
  5. +4
    -0
      modules/juce_core/native/juce_win32_SystemStats.cpp

+ 21
- 10
extras/Projucer/Source/LiveBuildEngine/projucer_CompileEngineClient.cpp View File

@@ -69,16 +69,18 @@ namespace ProjectProperties
static Value getLiveSetting (Project& p, const Identifier& i) { return getLiveSettings (p).getPropertyAsValue (i, p.getUndoManagerFor (getLiveSettings (p))); } static Value getLiveSetting (Project& p, const Identifier& i) { return getLiveSettings (p).getPropertyAsValue (i, p.getUndoManagerFor (getLiveSettings (p))); }
static var getLiveSettingVar (Project& p, const Identifier& i) { return getLiveSettingsConst (p) [i]; } static var getLiveSettingVar (Project& p, const Identifier& i) { return getLiveSettingsConst (p) [i]; }
static Value getUserHeaderPathValue (Project& p) { return getLiveSetting (p, Ids::headerPath); }
static String getUserHeaderPathString (Project& p) { return getLiveSettingVar (p, Ids::headerPath); }
static Value getSystemHeaderPathValue (Project& p) { return getLiveSetting (p, Ids::systemHeaderPath); }
static String getSystemHeaderPathString (Project& p) { return getLiveSettingVar (p, Ids::systemHeaderPath); }
static Value getExtraDLLsValue (Project& p) { return getLiveSetting (p, Ids::extraDLLs); }
static String getExtraDLLsString (Project& p) { return getLiveSettingVar (p, Ids::extraDLLs); }
static Value getExtraCompilerFlagsValue (Project& p) { return getLiveSetting (p, Ids::extraCompilerFlags); }
static String getExtraCompilerFlagsString (Project& p) { return getLiveSettingVar (p, Ids::extraCompilerFlags); }
static Value getExtraPreprocessorDefsValue (Project& p) { return getLiveSetting (p, Ids::defines); }
static String getExtraPreprocessorDefsString (Project& p) { return getLiveSettingVar (p, Ids::defines); }
static Value getUserHeaderPathValue (Project& p) { return getLiveSetting (p, Ids::headerPath); }
static String getUserHeaderPathString (Project& p) { return getLiveSettingVar (p, Ids::headerPath); }
static Value getSystemHeaderPathValue (Project& p) { return getLiveSetting (p, Ids::systemHeaderPath); }
static String getSystemHeaderPathString (Project& p) { return getLiveSettingVar (p, Ids::systemHeaderPath); }
static Value getExtraDLLsValue (Project& p) { return getLiveSetting (p, Ids::extraDLLs); }
static String getExtraDLLsString (Project& p) { return getLiveSettingVar (p, Ids::extraDLLs); }
static Value getExtraCompilerFlagsValue (Project& p) { return getLiveSetting (p, Ids::extraCompilerFlags); }
static String getExtraCompilerFlagsString (Project& p) { return getLiveSettingVar (p, Ids::extraCompilerFlags); }
static Value getExtraPreprocessorDefsValue (Project& p) { return getLiveSetting (p, Ids::defines); }
static String getExtraPreprocessorDefsString (Project& p) { return getLiveSettingVar (p, Ids::defines); }
static Value getWindowsTargetPlatformVersionValue (Project& p) { return getLiveSetting (p, Ids::liveWindowsTargetPlatformVersion); }
static String getWindowsTargetPlatformVersionString (Project& p) { return getLiveSettingVar (p, Ids::liveWindowsTargetPlatformVersion); }
static File getProjucerTempFolder() static File getProjucerTempFolder()
{ {
@@ -121,6 +123,13 @@ void LiveBuildProjectSettings::getLiveSettings (Project& project, PropertyListBu
props.add (new TextPropertyComponent (getExtraDLLsValue (project), "Extra dynamic libraries", 2048, true), props.add (new TextPropertyComponent (getExtraDLLsValue (project), "Extra dynamic libraries", 2048, true),
"Extra dynamic libs that the running code may require. Use new-lines or commas to separate the items"); "Extra dynamic libs that the running code may require. Use new-lines or commas to separate the items");
static const char* targetPlatformNames[] = { "(default)", "8.1", "10.0.10240.0", "10.0.10586.0", "10.0.14393.0", "10.0.15063.0", nullptr };
const var targetPlatforms[] = { var(), "8.1", "10.0.10240.0", "10.0.10586.0", "10.0.14393.0", "10.0.15063.0" };
props.add (new ChoicePropertyComponent (getWindowsTargetPlatformVersionValue (project), "Windows Target Platform",
StringArray (targetPlatformNames), Array<var> (targetPlatforms, numElementsInArray (targetPlatforms))),
"The Windows target platform to use");
} }
void LiveBuildProjectSettings::updateNewlyOpenedProject (Project&) { /* placeholder */ } void LiveBuildProjectSettings::updateNewlyOpenedProject (Project&) { /* placeholder */ }
@@ -325,6 +334,8 @@ public:
build.setUtilsCppInclude (project.getAppIncludeFile().getFullPathName()); build.setUtilsCppInclude (project.getAppIncludeFile().getFullPathName());
build.setWindowsTargetPlatformVersion (ProjectProperties::getWindowsTargetPlatformVersionString (project));
scanForProjectFiles (project, build); scanForProjectFiles (project, build);
owner.updateAllEditors(); owner.updateAllEditors();


+ 3
- 0
extras/Projucer/Source/LiveBuildEngine/projucer_ProjectBuildInfo.h View File

@@ -91,5 +91,8 @@ struct ProjectBuildInfo
StringArray getExtraDLLs() const { return separateJoinedStrings (tree [Ids::extraDLLs]); } StringArray getExtraDLLs() const { return separateJoinedStrings (tree [Ids::extraDLLs]); }
void setExtraDLLs (const StringArray& s) { tree.setProperty (Ids::extraDLLs, concatenateListOfStrings (s), nullptr); } void setExtraDLLs (const StringArray& s) { tree.setProperty (Ids::extraDLLs, concatenateListOfStrings (s), nullptr); }
String getWindowsTargetPlatformVersion() const { return tree [Ids::liveWindowsTargetPlatformVersion]; }
void setWindowsTargetPlatformVersion (const String& s) { tree.setProperty (Ids::liveWindowsTargetPlatformVersion, s, nullptr); }
ValueTree tree; ValueTree tree;
}; };

+ 1
- 0
extras/Projucer/Source/Utility/jucer_PresetIDs.h View File

@@ -83,6 +83,7 @@ namespace Ids
DECLARE_ID (defines); DECLARE_ID (defines);
DECLARE_ID (headerPath); DECLARE_ID (headerPath);
DECLARE_ID (systemHeaderPath); DECLARE_ID (systemHeaderPath);
DECLARE_ID (liveWindowsTargetPlatformVersion);
DECLARE_ID (libraryPath); DECLARE_ID (libraryPath);
DECLARE_ID (customXcodeFlags); DECLARE_ID (customXcodeFlags);
DECLARE_ID (customXcassetsFolder); DECLARE_ID (customXcassetsFolder);


+ 1
- 1
modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h View File

@@ -145,7 +145,7 @@ static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
/* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be /* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be
done safely because all x86_64 CPUs supports SSE2. */ done safely because all x86_64 CPUs supports SSE2. */
#if (defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__))
#if (! JUCE_PROJUCER_LIVE_BUILD) && ((defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__)))
# define VORBIS_FPU_CONTROL # define VORBIS_FPU_CONTROL
typedef ogg_int16_t vorbis_fpu_control; typedef ogg_int16_t vorbis_fpu_control;


+ 4
- 0
modules/juce_core/native/juce_win32_SystemStats.cpp View File

@@ -54,7 +54,11 @@ static void callCPUID (int result[4], uint32 type)
#else #else
static void callCPUID (int result[4], int infoType) static void callCPUID (int result[4], int infoType)
{ {
#if JUCE_PROJUCER_LIVE_BUILD
std::fill (result, result + 4, 0);
#else
__cpuid (result, infoType); __cpuid (result, infoType);
#endif
} }
#endif #endif


Loading…
Cancel
Save