Skip to content

Commit

Permalink
Build mojoshader.c and mojoshader_opengl.c into a static library.
Browse files Browse the repository at this point in the history
No sense in compiling them for each test app.

--HG--
branch : trunk
  • Loading branch information
icculus committed Jun 29, 2008
1 parent 86cd673 commit d5feffc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .hgignore
Expand Up @@ -9,5 +9,7 @@ bestprofile
finderrors
glcaps
*.exe
*.lib
*.a
ps_?_?
vs_?_?
16 changes: 10 additions & 6 deletions CMakeLists.txt
Expand Up @@ -13,20 +13,24 @@ IF(MSVC)
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 ...

0 comments on commit d5feffc

Please sign in to comment.