Opened 8 years ago

Closed 7 years ago

#214 closed defect (fixed)

make process hangs when compiling .rc file

Reported by: rudi Owned by:
Priority: major Milestone: Qt 4.7
Component: qmake Version: 4.6.3
Severity: low Keywords:
Cc:

Description

When an RC_FILE is specified in the project, QMAKE creates a call to compile resources. It looks like this:

set INCLUDE=%INCLUDE%;$(INCLUDEPATH) & $(RC) -n -r $(RC_FILE) $(RES_FILE)

In some cases %INCLUDE% gets too long for CMD.EXE (or RC.EXE ?) so that the build process will hang. Why do we need %INCLUDE% here at all ? In Windows this is not done either. When using the MinGW tool chain, only "." is specified to the "windres" tool and when using MSVC, they pass %DEFINES% and leave %INCLUDE% untouched.

Attachments (1)

mkspecs.diff (509 bytes) - added by rudi 7 years ago.
Force %INCLUDE% to be propagated to the eonvironment

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by dmik

  • Milestone changed from Qt Enhanced to Qt 4.7

comment:2 Changed 7 years ago by dmik

  • Resolution set to fixed
  • Status changed from new to closed

Although removing %INCLUDE% is not a solution since $(INCLUDEPATH) itself can be long too (resulting into the same failure or hang of RC.EXE), there is indeed no need to pass it to RC: for a qmake project, all include directories that an .rc file may need should be specified in the .pro file using the qmake INCLUDEPATH variable, not in the OS environment directly.

Regarding the proper fix for the problem, I did it in r880 by utilizing the handy Target-specific Variable feature of GNU make which fitted just perfectly here. It seems to work for very long include path lists, tried one much longer than 1024 chars.

comment:3 Changed 7 years ago by rudi

There is a small problem with the implementation. In case %INCLUDE% is not defined at all on the user's system, make does not propagate the variable into the environment. Find a fix attached. Make sure to apply change to mkspecs/default as well in case you don't reconfigure.

Changed 7 years ago by rudi

Force %INCLUDE% to be propagated to the eonvironment

comment:4 Changed 7 years ago by rudi

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:5 Changed 7 years ago by dmik

Yep, indeed. Interesting finding. Committed in r895. Thanks.

comment:6 Changed 7 years ago by dmik

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.