Skip to content

Commit 05a674a

Browse files
committed
Generate separate winrt projects.
1 parent 0e6bd63 commit 05a674a

19 files changed

+1597
-2090
lines changed

include/configGenerator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class ConfigGenerator
6161
ValuesList m_configValues;
6262
uint m_configValuesEnd{};
6363
string m_configureFile;
64-
string m_toolchain;
6564
bool m_isLibav{false};
6665
string m_projectName;
6766
string m_rootDirectory;

include/projectGenerator.h

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,16 @@ class ProjectGenerator
237237

238238
void buildInterDependencies(StaticList& libs);
239239

240-
void buildDependencies(StaticList& libs, StaticList& addLibs);
241-
242240
/**
243-
* Updates existing library dependency lists by adding/removing those required/unavailable by WinRT.
241+
* Gets library dependency lists.
244242
* @param [in,out] libs The project dependency libs.
245243
* @param [in,out] addLibs The windows dependency libs.
244+
* @param winrt True if checking for winrt.
246245
*/
247-
void buildDependenciesWinRT(StaticList& libs, StaticList& addLibs);
246+
void buildDependencies(StaticList& libs, StaticList& addLibs, bool winrt);
248247

249248
void buildDependencyValues(StaticList& includeDirs, StaticList& lib32Dirs, StaticList& lib64Dirs,
250-
StaticList& definesShared, StaticList& definesStatic) const;
249+
StaticList& definesShared, StaticList& definesStatic, bool winrt) const;
251250

252251
void buildProjectDependencies(map<string, bool>& projectDeps) const;
253252

@@ -278,7 +277,7 @@ class ProjectGenerator
278277
bool findProjectFiles(const StaticList& includes, StaticList& includesC, StaticList& includesCPP,
279278
StaticList& includesASM, StaticList& includesH, StaticList& includesCU) const;
280279

281-
void outputTemplateTags(string& projectTemplate, string& filtersTemplate) const;
280+
void outputTemplateTags(string& projectTemplate) const;
282281

283282
void outputSourceFileType(StaticList& fileList, const string& type, const string& filterType,
284283
string& projectTemplate, string& filterTemplate, StaticList& foundObjects, set<string>& foundFilters,
@@ -365,19 +364,7 @@ class ProjectGenerator
365364
*/
366365
void outputCUDATools(string& projectTemplate) const;
367366

368-
bool outputDependencyLibs(string& projectTemplate, bool program = false);
369-
370-
/**
371-
* Removes any WinRT/UWP configurations from the output project template.
372-
* @param [in,out] projectTemplate The project template.
373-
*/
374-
static void outputStripWinRT(string& projectTemplate);
375-
376-
/**
377-
* Removes any WinRT/UWP configurations from the output solution template.
378-
* @param [in,out] solutionFile The solution template.
379-
*/
380-
static void outputStripWinRTSolution(string& solutionFile);
367+
bool outputDependencyLibs(string& projectTemplate, bool winrt, bool program);
381368

382369
/**
383370
* Search through files in the current project and finds any undefined elements that are used in DCE blocks. A new

source/Templates.rc

86 Bytes
Binary file not shown.

source/configGenerator.cpp

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@
2424
#include <regex>
2525

2626
ConfigGenerator::ConfigGenerator()
27-
:
28-
#ifdef _MSC_VER
29-
m_toolchain("msvc")
30-
#elif defined(_WIN32)
31-
m_toolchain("mingw")
32-
#else
33-
m_toolchain("gcc")
34-
#endif
35-
, m_projectName("FFMPEG")
27+
: m_projectName("FFMPEG")
3628
{}
3729

3830
bool ConfigGenerator::passConfig(const int argc, char** argv)
@@ -345,7 +337,7 @@ bool ConfigGenerator::changeConfig(const string& option)
345337
outputLine(helpOptions);
346338
// Add in custom standard string
347339
outputLine("Standard options:");
348-
outputLine(" --prefix=PREFIX install in PREFIX [../../../msvc/]");
340+
// outputLine(" --prefix=PREFIX install in PREFIX [../../../msvc/]");
349341
// outputLine(" --bindir=DIR install binaries in DIR [PREFIX/bin]");
350342
// outputLine(" --libdir=DIR install libs in DIR [PREFIX/lib]");
351343
// outputLine(" --incdir=DIR install includes in DIR [PREFIX/include]");
@@ -355,7 +347,6 @@ bool ConfigGenerator::changeConfig(const string& option)
355347
" --use-existing-config use an existing config.h file found in rootdir, ignoring any other passed parameters affecting config");
356348
// Add in custom toolchain string
357349
outputLine("Toolchain options:");
358-
outputLine(" --toolchain=NAME set tool defaults according to NAME");
359350
outputLine(" --dce-only do not output a project and only generate missing DCE files");
360351
outputLine(
361352
" --use-yasm use YASM instead of the default NASM (this is not advised as it does not support newer instructions)");
@@ -368,63 +359,7 @@ bool ConfigGenerator::changeConfig(const string& option)
368359
}
369360
return false;
370361
}
371-
if (option.find("--toolchain") == 0) {
372-
// Check for correct command syntax
373-
if (option.at(11) != '=') {
374-
outputError("Incorrect toolchain syntax (" + option + ")");
375-
outputError("Excepted syntax (--toolchain=NAME)", false);
376-
return false;
377-
}
378-
// A tool chain has been specified
379-
string toolChain = option.substr(12);
380-
if (toolChain == "msvc") {
381-
// Don't disable inline as the configure header will auto header guard it out anyway. This allows for
382-
// changing on the fly afterwards
383-
} else if (toolChain == "icl") {
384-
// Inline asm by default is turned on if icl is detected
385-
} else {
386-
#ifdef _MSC_VER
387-
// Only support msvc when built with msvc
388-
outputError("Unknown toolchain option (" + toolChain + ")");
389-
outputError("Excepted toolchains (msvc, icl)", false);
390-
return false;
391-
#else
392-
// Only support other toolchains if DCE only
393-
if (!m_onlyDCE) {
394-
outputError("Unknown toolchain option (" + sToolChain + ")");
395-
outputError("Other toolchains are only supported if --dce-only has already been specified.", false);
396-
return false;
397-
} else {
398-
if ((toolChain.find("mingw") == string::npos) && (toolChain.find("gcc") == string::npos)) {
399-
outputError("Unknown toolchain option (" + toolChain + ")");
400-
outputError("Excepted toolchains (mingw*, gcc*)", false);
401-
return false;
402-
}
403-
}
404-
#endif
405-
}
406-
m_toolchain = toolChain;
407-
} else if (option.find("--prefix") == 0) {
408-
// Check for correct command syntax
409-
if (option.at(8) != '=') {
410-
outputError("Incorrect prefix syntax (" + option + ")");
411-
outputError("Excepted syntax (--prefix=PREFIX)", false);
412-
return false;
413-
}
414-
// A output dir has been specified
415-
string value = option.substr(9);
416-
m_outDirectory = value;
417-
// Convert '\' to '/'
418-
replace(m_outDirectory.begin(), m_outDirectory.end(), '\\', '/');
419-
// Check if a directory has been passed
420-
if (m_outDirectory.length() == 0) {
421-
m_outDirectory = "./";
422-
}
423-
// Check if directory has trailing '/'
424-
if (m_outDirectory.back() != '/') {
425-
m_outDirectory += '/';
426-
}
427-
} else if (option.find("--rootdir") == 0) {
362+
if (option.find("--rootdir") == 0) {
428363
// Check for correct command syntax
429364
if (option.at(9) != '=') {
430365
outputError("Incorrect rootdir syntax (" + option + ")");
@@ -516,7 +451,7 @@ bool ConfigGenerator::changeConfig(const string& option)
516451
// Find remainder of option
517452
option2 = option.substr(10);
518453
} else {
519-
outputError("Unknown command line option (" + option2 + ")");
454+
outputError("Unknown command line option (" + option + ")");
520455
outputError("Use --help to get available options", false);
521456
return false;
522457
}

source/configGenerator_build.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ bool ConfigGenerator::buildDefaultValues()
229229
fastToggleConfigValue("struct_pollfd", true);
230230
fastToggleConfigValue("struct_sockaddr_in6", true);
231231
fastToggleConfigValue("struct_sockaddr_storage", true);
232-
fastToggleConfigValue("unistd_h", true);
233-
fastToggleConfigValue("uwp", false);
232+
fastToggleConfigValue("unistd_h", false);
233+
fastToggleConfigValue("uwp", true);
234234
fastToggleConfigValue("VirtualAlloc", true);
235235
fastToggleConfigValue("windows_h", true);
236236
fastToggleConfigValue("winsock2_h", true);
237-
fastToggleConfigValue("winrt", false);
237+
fastToggleConfigValue("winrt", true);
238238
fastToggleConfigValue("wglgetprocaddress", true);
239239

240240
fastToggleConfigValue("aligned_stack", true);
@@ -951,8 +951,8 @@ void ConfigGenerator::buildReservedValues(vector<string>& reservedItems)
951951
reservedItems.emplace_back("small");
952952
reservedItems.emplace_back("lto");
953953
reservedItems.emplace_back("pic");
954-
// reservedItems.emplace_back("uwp");
955-
// reservedItems.emplace_back("winrt");
954+
reservedItems.emplace_back("uwp");
955+
reservedItems.emplace_back("winrt");
956956
}
957957

958958
void ConfigGenerator::buildAdditionalDependencies(DependencyList& additionalDependencies)

source/helperFunctions.cpp

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,34 @@
3131
# include <Windows.h>
3232
#else
3333
# include <dirent.h>
34-
extern char _binary_compat_h_start[];
35-
extern char _binary_compat_h_end[];
36-
extern char _binary_math_h_start[];
37-
extern char _binary_math_h_end[];
38-
extern char _binary_unistd_h_start[];
39-
extern char _binary_unistd_h_end[];
40-
extern char _binary_template_in_sln_start[];
41-
extern char _binary_template_in_sln_end[];
42-
extern char _binary_template_in_vcxproj_start[];
43-
extern char _binary_template_in_vcxproj_end[];
44-
extern char _binary_template_in_vcxproj_filters_start[];
45-
extern char _binary_template_in_vcxproj_filters_end[];
46-
extern char _binary_templateprogram_in_vcxproj_start[];
47-
extern char _binary_templateprogram_in_vcxproj_end[];
48-
extern char _binary_templateprogram_in_vcxproj_filters_start[];
49-
extern char _binary_templateprogram_in_vcxproj_filters_end[];
50-
extern char _binary_stdatomic_h_start[];
51-
extern char _binary_stdatomic_h_end[];
52-
const char* pp_cStartArray[] = {_binary_compat_h_start, _binary_math_h_start, _binary_unistd_h_start,
53-
_binary_template_in_sln_start, _binary_template_in_vcxproj_start, _binary_template_in_vcxproj_filters_start,
54-
_binary_templateprogram_in_vcxproj_start, _binary_templateprogram_in_vcxproj_filters_start,
55-
_binary_stdatomic_h_start};
56-
const char* pp_cEndArray[] = {_binary_compat_h_end, _binary_math_h_end, _binary_unistd_h_end,
57-
_binary_template_in_sln_end, _binary_template_in_vcxproj_end, _binary_template_in_vcxproj_filters_end,
58-
_binary_templateprogram_in_vcxproj_end, _binary_templateprogram_in_vcxproj_filters_end, _binary_stdatomic_h_end};
34+
extern char _binary_template_sln_start[];
35+
extern char _binary_template_sln_end[];
36+
extern char _binary_template_vcxproj_start[];
37+
extern char _binary_template_vcxproj_end[];
38+
extern char _binary_template_vcxproj_filters_start[];
39+
extern char _binary_template_vcxproj_filters_end[];
40+
extern char _binary_template_program_vcxproj_start[];
41+
extern char _binary_template_program_vcxproj_end[];
42+
extern char _binary_template_program_vcxproj_filters_start[];
43+
extern char _binary_template_program_vcxproj_filters_end[];
44+
extern char _binary_template_bat_start[];
45+
extern char _binary_template_bat_end[];
46+
extern char _binary_template_vcxproj_winrt_start[];
47+
extern char _binary_template_vcxproj_winrt_end[];
48+
extern char _binary_template_props_start[];
49+
extern char _binary_template_props_end[];
50+
extern char _binary_template_props_winrt_start[];
51+
extern char _binary_template_props_winrt_end[];
52+
extern char _binary_template_file_props_start[];
53+
extern char _binary_template_file_props_end[];
54+
const char* pp_cStartArray[] = {_binary_template_sln_start, _binary_template_vcxproj_start,
55+
_binary_template_vcxproj_filters_start, _binary_template_program_vcxproj_start,
56+
_binary_template_program_vcxproj_filters_start, _binary_template_bat_start, _binary_template_vcxproj_winrt_start,
57+
_binary_template_props_start, _binary_template_props_winrt_start, _binary_template_file_props_start};
58+
const char* pp_cEndArray[] = {_binary_template_sln_end, _binary_template_vcxproj_end,
59+
_binary_template_vcxproj_filters_end, _binary_template_program_vcxproj_end,
60+
_binary_template_program_vcxproj_filters_end, _binary_template_bat_end, _binary_template_vcxproj_winrt_end,
61+
_binary_template_props_end, _binary_template_props_winrt_end, _binary_template_file_props_end};
5962
#endif
6063

6164
#if _DEBUG

0 commit comments

Comments
 (0)