From d5feffc201662400f20c7567c9edf8c188927bab Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 29 Jun 2008 02:06:08 -0400 Subject: [PATCH] Build mojoshader.c and mojoshader_opengl.c into a static library. No sense in compiling them for each test app. --HG-- branch : trunk --- .hgignore | 2 ++ CMakeLists.txt | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.hgignore b/.hgignore index 54f47a14..a2982373 100644 --- a/.hgignore +++ b/.hgignore @@ -9,5 +9,7 @@ bestprofile finderrors glcaps *.exe +*.lib +*.a ps_?_? vs_?_? diff --git a/CMakeLists.txt b/CMakeLists.txt index 35516e30..3383c518 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ...