Skip to content

Commit

Permalink
ide; windres support for forced 32 bit builds. and showing resources.…
Browse files Browse the repository at this point in the history
…rc instead of resources.o in build log. closes #877
  • Loading branch information
redj authored and jerstlouis committed May 10, 2013
1 parent 392bbe4 commit d694eea
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions ide/src/IDESettings.ec
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ public:
get { return executableLauncher; }
isset { return executableLauncher && executableLauncher[0]; }
}
// TODO: implement CompilerConfig::windresCommand
bool ccacheEnabled;
bool distccEnabled;
// deprecated
Expand Down
23 changes: 18 additions & 5 deletions ide/src/project/Project.ec
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,8 @@ private:
char * configName = config ? config.name : "Common";
int lenMakeCommand = strlen(compiler.makeCommand);
int testLen = 0;

char * t;
char moduleName[MAX_FILENAME];
char * gnuToolchainPrefix = compiler.gnuToolchainPrefix ? compiler.gnuToolchainPrefix : "";

DynamicString test { };
Expand Down Expand Up @@ -1534,8 +1535,6 @@ private:
else if(strstr(test, strip) == test);
else if(strstr(test, cc) == test || strstr(test, cxx) == test || strstr(test, ecp) == test || strstr(test, ecc) == test)
{
char moduleName[MAX_FILENAME];
byte * tokens[1];
char * module;
bool isPrecomp = false;
bool gotCC = false;
Expand Down Expand Up @@ -1569,6 +1568,7 @@ private:

if(module)
{
byte * tokens[1];
if(!compiling && !isPrecomp)
{
ide.outputView.buildBox.Logf($"Compiling...\n");
Expand Down Expand Up @@ -1604,12 +1604,13 @@ private:
}
else if(strstr(test, windres) == test)
{
char moduleName[MAX_FILENAME];
char * module;
module = strstr(line, " ");
if(module) module = strstr(module+1, " ");
if(module) module++;
if(module)
{
byte * tokens[1];
Tokenize(module, 1, tokens, true);
GetLastDirectory(module, moduleName);
ide.outputView.buildBox.Logf("%s\n", moduleName);
}
Expand Down Expand Up @@ -2379,6 +2380,18 @@ private:
f.Puts("LD := $(GCC_PREFIX)ld\n");
f.Puts("AR := $(GCC_PREFIX)ar\n");
f.Puts("STRIP := $(GCC_PREFIX)strip\n");
f.Puts("ifdef WINDOWS_TARGET\n");
f.Puts("WINDRES := $(GCC_PREFIX)windres\n");
f.Puts(" ifdef ARCH\n");
f.Puts(" ifeq \"$(ARCH)\" \"x32\"\n");
f.Puts("WINDRES_FLAGS := -F pe-i386\n");
f.Puts(" else\n");
f.Puts(" ifeq \"$(ARCH)\" \"x64\"\n");
f.Puts("WINDRES_FLAGS := -F pe-x86-64\n");
f.Puts(" endif\n");
f.Puts(" endif\n");
f.Puts(" endif\n");
f.Puts("endif\n");
f.Puts("UPX := upx\n");
f.Puts("\n");

Expand Down
2 changes: 1 addition & 1 deletion ide/src/project/ProjectNode.ec
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,7 @@ private:
if(!strcmpi(extension, "cc") || !strcmpi(extension, "cpp") || !strcmpi(extension, "cxx"))
f.Printf("\t$(CXX)");
else if(!strcmpi(extension, "rc"))
f.Printf("\t$(GCC_PREFIX)windres $< $@\n"); //$(WINDRES) // TODO: implement CompilerConfig::windresCommand
f.Printf("\t$(WINDRES) $(WINDRES_FLAGS) $< $@\n");
else
f.Printf("\t$(CC)");

Expand Down

0 comments on commit d694eea

Please sign in to comment.