Commit 204ec087 by Chinmay Garde

Add a CMake option to toggle building extra programs.

Change-Id: I6b63d75ee2b18be92544227ff0162936f5a2328f Reviewed-on: https://swiftshader-review.googlesource.com/6910Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarChinmay Garde <chinmaygarde@google.com>
parent f241f930
...@@ -13,6 +13,8 @@ option(BUILD_GLES_CM "Build the OpenGL ES 1.1 library" 1) ...@@ -13,6 +13,8 @@ option(BUILD_GLES_CM "Build the OpenGL ES 1.1 library" 1)
option(USE_GROUP_SOURCES "Group the source files in a folder tree for visual studio" 1) option(USE_GROUP_SOURCES "Group the source files in a folder tree for visual studio" 1)
option(BUILD_EXTRA_PROGRAMS "Build extra programs" 1)
# LLVM disallows calling cmake . from the main LLVM dir, the reason is that # LLVM disallows calling cmake . from the main LLVM dir, the reason is that
# it builds header files that could overwrite the orignal ones. Here we # it builds header files that could overwrite the orignal ones. Here we
# want to include LLVM as a subdirectory and even though it wouldn't cause # want to include LLVM as a subdirectory and even though it wouldn't cause
...@@ -827,21 +829,23 @@ endif() ...@@ -827,21 +829,23 @@ endif()
# Extra programs # Extra programs
########################################################### ###########################################################
if(LINUX) if(BUILD_EXTRA_PROGRAMS)
add_executable(OGLES2HelloAPI ${HELLO2_DIR}/OGLES2HelloAPI_LinuxX11.cpp) if(LINUX)
target_link_libraries(OGLES2HelloAPI dl X11 EGL GLESv2) add_executable(OGLES2HelloAPI ${HELLO2_DIR}/OGLES2HelloAPI_LinuxX11.cpp)
elseif(APPLE) target_link_libraries(OGLES2HelloAPI dl X11 EGL GLESv2)
add_executable(OGLES2HelloAPI MACOSX_BUNDLE elseif(APPLE)
${HELLO2_DIR}/OGLES2HelloAPI_OSX.mm add_executable(OGLES2HelloAPI MACOSX_BUNDLE
${HELLO2_DIR}/Build/OSX/en.lproj/MainMenu.xib ${HELLO2_DIR}/OGLES2HelloAPI_OSX.mm
) ${HELLO2_DIR}/Build/OSX/en.lproj/MainMenu.xib
set_target_properties(OGLES2HelloAPI PROPERTIES )
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/include" set_target_properties(OGLES2HelloAPI PROPERTIES
COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES" INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/include"
MACOSX_BUNDLE_INFO_PLIST "${HELLO2_DIR}/Build/OSX/Info.plist" COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES"
) MACOSX_BUNDLE_INFO_PLIST "${HELLO2_DIR}/Build/OSX/Info.plist"
target_link_libraries(OGLES2HelloAPI libEGL libGLESv2 ${OS_LIBS}) )
set_source_files_properties(${HELLO2_DIR}/Build/OSX/en.lproj/MainMenu.xib PROPERTIES target_link_libraries(OGLES2HelloAPI libEGL libGLESv2 ${OS_LIBS})
MACOSX_PACKAGE_LOCATION "Resources" set_source_files_properties(${HELLO2_DIR}/Build/OSX/en.lproj/MainMenu.xib PROPERTIES
) MACOSX_PACKAGE_LOCATION "Resources"
)
endif()
endif() endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment