From 71e885f94167ee555cd2dc84d62db174c8712570 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 11 Feb 2022 14:04:18 +0800 Subject: [PATCH] - fix: huge build size for c++ files --- NEWS.md | 1 + RedPandaIDE/compiler/compiler.cpp | 3 ++ RedPandaIDE/resources/autolink.json | 2 +- windows/templates/CL_GLUT.ico | Bin 4286 -> 1150 bytes windows/templates/CL_GLUT.template | 18 ++++++++--- windows/templates/CL_GLUT_cpp.txt | 46 ---------------------------- 6 files changed, 18 insertions(+), 52 deletions(-) delete mode 100644 windows/templates/CL_GLUT_cpp.txt diff --git a/NEWS.md b/NEWS.md index f25bf719..917cdbef 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ Red Panda C++ Version 0.14.2 - enhancement: remove / rename / create new folder in the files view - fix: crash when there are catch blocks in the upper most scope - fix: can't read project templates when path has non-ascii chars + - fix: huge build size for c++ files Red Panda C++ Version 0.14.1 - enhancement: custom theme diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index be4fbaec..7114bd31 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -569,6 +569,9 @@ void Compiler::runCommand(const QString &cmd, const QString &arguments, const Q env.insert("PATH",path); } env.insert("LANG","en"); + env.insert("LDFLAGS","-Wl,--stack,12582912"); + env.insert("CFLAGS",""); + env.insert("CXXFLAGS",""); process.setProcessEnvironment(env); process.setArguments(splitProcessCommand(arguments)); process.setWorkingDirectory(workingDir); diff --git a/RedPandaIDE/resources/autolink.json b/RedPandaIDE/resources/autolink.json index 732754c7..a0d8d792 100644 --- a/RedPandaIDE/resources/autolink.json +++ b/RedPandaIDE/resources/autolink.json @@ -1,7 +1,7 @@ [ { "header": "GL/freeglut.h", - "links": "-lfreeglut -lwinmm" + "links": "-lfreeglut.dll -lwinmm" }, { "header": "GL/gl.h", diff --git a/windows/templates/CL_GLUT.ico b/windows/templates/CL_GLUT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;PD&^&d54SGR{ z!*gG8P@WU`f5qqdgmtJW?MJr!Ce|?bv3rXLf3F;bQB#4;^vjUPw?Mg$I3zVvZ0t~_ zUIQzSTuOA%6sUr`uZG#1pm!A=jE4#oKo zC+i_hdlOk1bx^Hsr#Nu&tH(=wyB~uO*Fo2vhdB186_YcQsQLE@3N`iEoLz%w)?2VG z*NXL-EzqVnpg=|ahL2ICy@m~@Hf+pxK%3Ew13&AgTIwf_7jWi}_mLi7jx6~V$|K^P z&_)_H;+va0R^f-SN2sR1vE>?)qi7EM7sxZppp=$iYjG)_DgGO_dbtn6_`4`Q zJ;K|zTpxohwgd8LC(Y@kx^PnLoD}~SeD7mTOu&kv~Xge8Pq3r*TE+3$xUZV-~F zek4$SB~V^I`=uUa%Pf=wRZu53kiK4+wfzvpcyO_N0&dqRa#f8GMKx0`HdFoBkQsfC zYN3njq8$f+{AxRdq?1nMCmlRcCAwkE@LEA!*)#kDZ9?@+zG3%#NeI$1e!XrcOaLrLqCh-%YndC233 z^Zmq$I^^da$J3imVne}O*!QTZrmN}*wo!k|4t?`OcKQmsb&!P0t?%=F;-9d6zRSN_~y%e7zp^g7a# zjzg#ZGgQ*EP>U-l2QEmHjxp1pe|THd>!AKo(cc+sNNa{uKFP$|Vk*uB;mx zxrg=zFVe}6BZuze+q=(_X0L%&)xx}K1o~Y1Zt_B-rL~**D#TuhQ#j5ps$2I;%(*ir z@BXTv<>eqQR5-9@<9TSc-N-I*!L+^?IXQ0RntjMM`H^Svp~&b#c4jx)Tc&A#07s90 zgza1HbOsp4v)}P!&v*TJeh*#G`S9Zxy*RLc7!_r7_L~ZUhW%azPA|(V=dJPaSv21q zr~P#T9j#Ni=bVM>-U58C00#X5JQ!Z2_|IWskrw8awlEjK{7jJ6YVI7ts!md>RG9{|ET2?*9QuT;ad~ diff --git a/windows/templates/CL_GLUT.template b/windows/templates/CL_GLUT.template index e9c79c5f..e16db4bc 100644 --- a/windows/templates/CL_GLUT.template +++ b/windows/templates/CL_GLUT.template @@ -8,14 +8,22 @@ Category=3D Category[zh_CN]=3D [Unit0] -CppName=main.cpp -C=CL_GLUT_cpp.txt +CName=main.c +C=CL_GLUT_shapes.c.txt + +[Unit1] +CName=glmatrix.h +C=CL_GLUT_glmatrix.h.txt + +[Unit2] +CName=glmatrix.c +C=CL_GLUT_glmatrix.c.txt [Project] -UnitCount=1 +UnitCount=3 Type=0 -IsCpp=1 -linker=-lm -lfreeglut_static -lopengl32 -lwinmm -lgdi32_@@__@@_ +IsCpp=0 +linker=-lm -lfreeglut.dll -lopengl32 -lwinmm -lgdi32_@@__@@_ diff --git a/windows/templates/CL_GLUT_cpp.txt b/windows/templates/CL_GLUT_cpp.txt deleted file mode 100644 index 4a500867..00000000 --- a/windows/templates/CL_GLUT_cpp.txt +++ /dev/null @@ -1,46 +0,0 @@ -#define FREEGLUT_STATIC -#include -#include - -void keyboard(unsigned char key, int x, int y); -void display(void); - - -int main(int argc, char** argv) -{ - glutInit(&argc, argv); - glutCreateWindow("GLUT Test"); - glutKeyboardFunc(&keyboard); - glutDisplayFunc(&display); - glutMainLoop(); - - return EXIT_SUCCESS; -} - - -void keyboard(unsigned char key, int x, int y) -{ - switch (key) - { - case '\x1B': - exit(EXIT_SUCCESS); - break; - } -} - - -void display() -{ - glClear(GL_COLOR_BUFFER_BIT); - - glColor3f(1.0f, 0.0f, 0.0f); - - glBegin(GL_POLYGON); - glVertex2f(-0.5f, -0.5f); - glVertex2f( 0.5f, -0.5f); - glVertex2f( 0.5f, 0.5f); - glVertex2f(-0.5f, 0.5f); - glEnd(); - - glFlush(); -} \ No newline at end of file