Build mojoshader.c and mojoshader_opengl.c into a static library. trunk
authorRyan C. Gordon <icculus@icculus.org>
Sun, 29 Jun 2008 02:06:08 -0400
branchtrunk
changeset 415 25ca83d8bbd5
parent 414 fdb12120213e
child 416 4723b41cd184
Build mojoshader.c and mojoshader_opengl.c into a static library. No sense in compiling them for each test app.
.hgignore
CMakeLists.txt
--- a/.hgignore	Sun Jun 29 02:00:46 2008 -0400
+++ b/.hgignore	Sun Jun 29 02:06:08 2008 -0400
@@ -9,5 +9,7 @@
 finderrors
 glcaps
 *.exe
+*.lib
+*.a
 ps_?_?
 vs_?_?
--- a/CMakeLists.txt	Sun Jun 29 02:00:46 2008 -0400
+++ b/CMakeLists.txt	Sun Jun 29 02:06:08 2008 -0400
@@ -13,20 +13,24 @@
     ADD_DEFINITIONS(-TP)  # force .c files to compile as C++.
 ENDIF(MSVC)
 
+ADD_LIBRARY(mojoshader STATIC mojoshader.c mojoshader_opengl.c)
+
 FIND_PACKAGE(SDL)
 IF(SDL_FOUND)
     INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
     ADD_DEFINITIONS(-DFINDERRORS_COMPILE_SHADERS=1)
     ADD_EXECUTABLE(glcaps glcaps.c)
     TARGET_LINK_LIBRARIES(glcaps ${SDL_LIBRARY})
-    ADD_EXECUTABLE(bestprofile bestprofile.c mojoshader.c mojoshader_opengl.c)
-    TARGET_LINK_LIBRARIES(bestprofile ${SDL_LIBRARY})
+    ADD_EXECUTABLE(bestprofile bestprofile.c)
+    TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL_LIBRARY})
 ENDIF(SDL_FOUND)
 
-ADD_EXECUTABLE(testparse testparse.c mojoshader.c)
-ADD_EXECUTABLE(testoutput testoutput.c mojoshader.c)
-ADD_EXECUTABLE(finderrors finderrors.c mojoshader.c mojoshader_opengl.c)
-TARGET_LINK_LIBRARIES(finderrors ${SDL_LIBRARY} ${EXTRA_LIBS})
+ADD_EXECUTABLE(testparse testparse.c)
+TARGET_LINK_LIBRARIES(testparse mojoshader)
+ADD_EXECUTABLE(testoutput testoutput.c)
+TARGET_LINK_LIBRARIES(testoutput mojoshader)
+ADD_EXECUTABLE(finderrors finderrors.c)
+TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL_LIBRARY})
 
 # End of CMakeLists.txt ...