added more flags
authorRafael Gaitán Linares <rgaitan@sparrow-2.local>
Mon, 7 Dec 2009 01:40:52 +0000 (02:40 +0100)
committerRafael Gaitán Linares <rgaitan@sparrow-2.local>
Mon, 7 Dec 2009 01:40:52 +0000 (02:40 +0100)
CMakeLists.txt
main.c

index 81d9f0dde2ef7ce76a7b9aa2daca492ab6d7772e..1747f5a9b07c1d54e3e51495a59af30790600063 100644 (file)
@@ -22,6 +22,10 @@ CONFIGURE_DEFAULTS()
 \r
 FIND_PACKAGE(OpenGL)\r
 FIND_PACKAGE(SDL)\r
+FIND_PACKAGE(Threads)\r
+\r
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -Os -std=c99 -fomit-frame-pointer -ffast-math -Wall -DX86_ASM -fno-strict-aliasing -DDEBUG")\r
+SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -m32 -nostdlib -nostartfiles")\r
 \r
 link_directories(${LIBRARY_OUTPUT_PATH})\r
 \r
@@ -39,6 +43,9 @@ include_directories(
 SET(LIBRARIES \r
        ${SDL_LIBRARIES} \r
        ${OPENGL_LIBRARIES}\r
+       m\r
+       dl\r
+       ${CMAKE_THREAD_LIBS_INIT}\r
 )\r
 \r
 SETUP_DEMO_LAUNCHER(${DEMO_NAME})\r
diff --git a/main.c b/main.c
index 12cafac63a7d652481e1bd56e9c39a2e4034d31c..03349b0b8899c5c5130bdbf003d052126871213a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -331,7 +331,7 @@ fn.glUseProgram(0);
 }
 
 #ifdef DEBUG
-int main()
+int main(int argc, char **argv)
 #else
 void __attribute__((externally_visible)) _start(void)
 #endif
@@ -376,7 +376,7 @@ void __attribute__((externally_visible)) _start(void)
        } while(event.type != SDL_KEYDOWN);
 
        fn.SDL_Quit();
-
+       
 #if 1
        __asm__("xorl %eax, %eax\n\t"
            "incl %eax\n\t"
@@ -384,5 +384,6 @@ void __attribute__((externally_visible)) _start(void)
 #else
        exit(0);
 #endif
+       return 0;
 }