bgfx/3rdparty/glsl-optimizer/CMakeLists.txt

51 lines
1.8 KiB
Text
Raw Normal View History

2012-04-03 23:30:07 -04:00
cmake_minimum_required(VERSION 2.8)
include_directories(include)
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)
2014-02-11 02:06:13 -05:00
#file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c)
#list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove})
2012-04-03 23:30:07 -04:00
add_library(glcpp-library ${glcpp-library_sources})
2014-02-11 02:06:13 -05:00
file(GLOB mesa_sources src/mesa/program/*.c src/mesa/main/*.c)
2012-04-03 23:30:07 -04:00
add_library(mesa ${mesa_sources})
file(GLOB glsl_sources src/glsl/*.cpp src/glsl/*.c)
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)
2014-10-11 15:32:43 -04:00
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# OSX-specific build requirements
find_library(OpenGL_LIBRARY OpenGL )
target_link_libraries(glsl_test ${OpenGL_LIBRARY})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
2012-04-03 23:30:07 -04:00
file(GLOB glslopt_sources contrib/glslopt/*.cpp)
add_executable(glslopt ${glslopt_sources})
target_link_libraries(glslopt glsl_optimizer)
2014-02-11 02:06:13 -05:00
#add_executable(glcpp src/glsl/glcpp/glcpp.c)
#target_link_libraries(glcpp glsl_optimizer)