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.ico index 2a515ce7..c2b1575b 100644 Binary files a/windows/templates/CL_GLUT.ico and b/windows/templates/CL_GLUT.ico differ 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