Disabled real-time visualization by default. SDL2 is no longer a dependency when building with the default flags.
This commit is contained in:
@@ -27,6 +27,7 @@ option(DOUBLE_PRECISION "Generates double precision code" OFF)
|
||||
option(TIARA_CLUSTER "Special settings for compilation TIARA GPU cluster" OFF)
|
||||
option(MULTIGPU_ENABLED "If enabled, uses all the available GPUs" ON)
|
||||
option(ALTER_CONF "If enabled, loads astaroth.conf from the build directory" OFF)
|
||||
option(BUILD_RT_VISUALIZATION "Builds the module for real-time visualization using SDL2" OFF)
|
||||
|
||||
#-------------------Determine build type--------------------------------------#
|
||||
|
||||
@@ -56,12 +57,15 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# SDL 2
|
||||
set(SDL2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/SDL2/include/)
|
||||
set(SDL2_LIBRARY_DIR ${CMAKE_SOURCE_DIR}/3rdparty/SDL2/build/)
|
||||
set(SDL2_LIBRARY "SDL2")
|
||||
include_directories(${SDL2_INCLUDE_DIR})
|
||||
link_directories(${SDL2_LIBRARY_DIR})
|
||||
if (BUILD_RT_VISUALIZATION)
|
||||
add_definitions(-DAC_BUILD_RT_VISUALIZATION=1)
|
||||
# SDL 2
|
||||
set(SDL2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/SDL2/include/)
|
||||
set(SDL2_LIBRARY_DIR ${CMAKE_SOURCE_DIR}/3rdparty/SDL2/build/)
|
||||
set(SDL2_LIBRARY "SDL2")
|
||||
include_directories(${SDL2_INCLUDE_DIR})
|
||||
link_directories(${SDL2_LIBRARY_DIR})
|
||||
endif()
|
||||
|
||||
# CUDA
|
||||
find_package(CUDA)
|
||||
|
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
#include "run.h"
|
||||
|
||||
#if AC_BUILD_RT_VISUALIZATION
|
||||
#include <SDL.h> // Note: using local version in src/3rdparty dir
|
||||
#include <math.h> // ceil
|
||||
#include <string.h> // memcpy
|
||||
@@ -421,3 +422,12 @@ run_renderer(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else // BUILD_RT_VISUALIZATION == 0
|
||||
#include "core/errchk.h"
|
||||
int
|
||||
run_renderer(void)
|
||||
{
|
||||
WARNING("Real-time visualization module not built. Set BUILD_RT_VISUALIZATION=ON with cmake.");
|
||||
return 1;
|
||||
}
|
||||
#endif // BUILD_RT_VISUALIZATION
|
||||
|
Reference in New Issue
Block a user