Permalink
Browse files

Merge pull request #5 from kalimaul/master

Updates and fixes for cmake build system
  • Loading branch information...
2 parents 15f5a97 + 5732e89 commit 0d8f273799ccb52aa53f7382043c498a007c8823 @aras-p aras-p committed Jan 22, 2012
Showing with 22 additions and 4 deletions.
  1. +3 −0 .gitignore
  2. +19 −4 CMakeLists.txt
View
@@ -52,3 +52,6 @@ glsl_main
glsl_test
glcpp
glslopt
+glsl_compiler
+.settings/
+.pydevproject
View
@@ -5,18 +5,34 @@ include_directories(src/mesa)
include_directories(src/mapi)
include_directories(src/glsl)
+option (DEBUG "Enable debugging" FALSE)
+
+if(${DEBUG} MATCHES "on")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0")
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -DNDEBUG")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -DNDEBUG")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
+endif()
+
file(GLOB glcpp-library_sources src/glsl/glcpp/*.c)
-list(REMOVE_ITEM glcpp-library_sources src/glsl/glcpp/glcpp.c)
+file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c)
+list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove})
add_library(glcpp-library ${glcpp-library_sources})
file(GLOB mesa_sources src/mesa/program/*.c)
add_library(mesa ${mesa_sources})
file(GLOB glsl_sources src/glsl/*.cpp src/glsl/*.c)
-list(REMOVE_ITEM glsl_sources src/glsl/main.cpp)
+file(GLOB glsl_sources_remove src/glsl/main.cpp src/glsl/builtin_stubs.cpp)
+list(REMOVE_ITEM glsl_sources ${glsl_sources_remove})
add_library(glsl_optimizer ${glsl_sources})
target_link_libraries(glsl_optimizer glcpp-library mesa)
+add_executable(glsl_compiler src/glsl/main.cpp)
+target_link_libraries(glsl_compiler glsl_optimizer)
+
file(GLOB glsl_test_sources tests/*.cpp)
add_executable(glsl_test ${glsl_test_sources})
target_link_libraries(glsl_test glsl_optimizer)
@@ -25,6 +41,5 @@ file(GLOB glslopt_sources contrib/glslopt/*.cpp)
add_executable(glslopt ${glslopt_sources})
target_link_libraries(glslopt glsl_optimizer)
-file(GLOB glcpp_sources src/glsl/glcpp/glcpp.c)
-add_executable(glcpp ${glcpp_sources})
+add_executable(glcpp src/glsl/glcpp/glcpp.c)
target_link_libraries(glcpp glsl_optimizer)

0 comments on commit 0d8f273

Please sign in to comment.