1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

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

This commit is contained in:
ed 2017-05-04 12:47:18 +01:00
parent ece2d8b7c0
commit fa0b097652
5 changed files with 30 additions and 11 deletions

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 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()
{
@ -121,6 +123,13 @@ void LiveBuildProjectSettings::getLiveSettings (Project& project, PropertyListBu
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");
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 */ }
@ -325,6 +334,8 @@ public:
build.setUtilsCppInclude (project.getAppIncludeFile().getFullPathName());
build.setWindowsTargetPlatformVersion (ProjectProperties::getWindowsTargetPlatformVersionString (project));
scanForProjectFiles (project, build);
owner.updateAllEditors();

View file

@ -91,5 +91,8 @@ struct ProjectBuildInfo
StringArray getExtraDLLs() const { return separateJoinedStrings (tree [Ids::extraDLLs]); }
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;
};

View file

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

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
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
typedef ogg_int16_t vorbis_fpu_control;

View file

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