Pārlūkot izejas kodu

Change the way external CMake projects work. That will fix some build issues

Panagiotis Christopoulos Charitos 9 gadi atpakaļ
vecāks
revīzija
75a7f75cac
44 mainītis faili ar 144 papildinājumiem un 197 dzēšanām
  1. 3 3
      .travis.yml
  2. 70 134
      CMakeLists.txt
  3. 1 1
      README.md
  4. 3 2
      src/anki/Config.h.cmake
  5. 1 1
      src/anki/collision/GjkEpaInternal.h
  6. 15 4
      src/anki/core/App.cpp
  7. 1 1
      src/anki/core/CMakeLists.txt
  8. 1 1
      src/anki/gr/CMakeLists.txt
  9. 2 2
      src/anki/gr/gl/Buffer.cpp
  10. 1 1
      src/anki/gr/gl/BufferImpl.h
  11. 1 1
      src/anki/gr/gl/CommandBuffer.cpp
  12. 3 4
      src/anki/gr/gl/CommandBufferImpl.cpp
  13. 2 2
      src/anki/gr/gl/CommandBufferImpl.h
  14. 1 1
      src/anki/gr/gl/Error.h
  15. 1 1
      src/anki/gr/gl/GrManagerImpl.h
  16. 1 1
      src/anki/gr/gl/ShaderImpl.cpp
  17. 1 1
      src/anki/gr/gl/StateTracker.h
  18. 1 1
      src/anki/gr/vulkan/BufferImpl.cpp
  19. 2 2
      src/anki/gr/vulkan/BufferImpl.h
  20. 1 1
      src/anki/gr/vulkan/CommandBufferImpl.h
  21. 1 1
      src/anki/gr/vulkan/GrManagerImpl.h
  22. 1 1
      src/anki/gr/vulkan/ShaderImpl.cpp
  23. 1 1
      src/anki/math/Functions.cpp
  24. 1 1
      src/anki/physics/CMakeLists.txt
  25. 1 1
      src/anki/physics/PhysicsCollisionShape.cpp
  26. 1 1
      src/anki/renderer/Ms.cpp
  27. 2 2
      src/anki/renderer/Sm.cpp
  28. 1 1
      src/anki/scene/ReflectionProxyComponent.cpp
  29. 1 1
      src/anki/scene/SceneNode.cpp
  30. 1 1
      src/anki/scene/Sector.cpp
  31. 1 1
      src/anki/ui/CMakeLists.txt
  32. 1 1
      src/anki/util/Assert.cpp
  33. 1 1
      src/anki/util/Assert.h
  34. 1 1
      src/anki/util/DynamicArray.h
  35. 1 1
      src/anki/util/Functions.h
  36. 2 2
      src/anki/util/Memory.cpp
  37. 1 1
      src/anki/util/Memory.h
  38. 1 1
      src/anki/util/StdTypes.h
  39. 1 1
      src/anki/util/Thread.h
  40. 1 1
      src/anki/util/ThreadHive.cpp
  41. 2 2
      src/anki/util/ThreadPosix.cpp
  42. 2 2
      src/anki/util/ThreadWindows.cpp
  43. 5 5
      src/anki/util/Visitor.h
  44. 1 1
      thirdparty

+ 3 - 3
.travis.yml

@@ -10,8 +10,8 @@ compiler:
   - clang
   - clang
 
 
 env:
 env:
-  - OPTIMIZE=ON TRACE=ON
-  - OPTIMIZE=OFF TRACE=OFF
+  - BUILD_TYPE=Debug EXTRA_CHECKS=ON TRACE=ON
+  - BUILD_TYPE=Release EXTRA_CHECKS=OFF TRACE=OFF
 
 
 cache:
 cache:
   apt: true
   apt: true
@@ -32,7 +32,7 @@ before_install:
 script:
 script:
   - mkdir build 
   - mkdir build 
   - cd build
   - cd build
-  - cmake .. -DANKI_OPTIMIZE=${OPTIMIZE} -DANKI_DEBUG=${OPTIMIZE} -DANKI_DEBUG_SYMBOLS=OFF -DANKI_BUILD_TOOLS=ON -DANKI_BUILD_TESTS=ON -DANKI_ENABLE_TRACE=${TRACE}
+  - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DANKI_EXTRA_CHECKS=${EXTRA_CHECKS} -DANKI_BUILD_TOOLS=ON -DANKI_BUILD_TESTS=ON -DANKI_ENABLE_TRACE=${TRACE}
   - make
   - make
 
 
 branches:
 branches:

+ 70 - 134
CMakeLists.txt

@@ -39,23 +39,11 @@ else()
 	set(GCC FALSE)
 	set(GCC FALSE)
 endif()
 endif()
 
 
-################################################################################
-# Some functions                                                               #
-################################################################################
-
-macro(defineStaticExternalLibrary extProj extLib extLibFname)
-	add_library(${extLib} STATIC IMPORTED GLOBAL)
-	set_target_properties(${extLib} PROPERTIES IMPORTED_LOCATION ${extLibFname})
-	add_dependencies(${extLib} ${extProj})
-endmacro()
-
 ################################################################################
 ################################################################################
 # Configuration                                                                #
 # Configuration                                                                #
 ################################################################################
 ################################################################################
 
 
-option(ANKI_OPTIMIZE "Optimize" ON)
-option(ANKI_DEBUG_SYMBOLS "Debug symbols" OFF)
-option(ANKI_DEBUG "Debugging checks" OFF)
+option(ANKI_EXTRA_CHECKS "Debugging checks (assertions)" OFF)
 option(ANKI_LTO "LTO compilation" OFF)
 option(ANKI_LTO "LTO compilation" OFF)
 
 
 option(ANKI_BUILD_TOOLS "Build tools" OFF)
 option(ANKI_BUILD_TOOLS "Build tools" OFF)
@@ -77,12 +65,6 @@ set(ANKI_CPU_ADDR_SPACE "0" CACHE STRING "The CPU architecture (0 or 32 or 64).
 
 
 option(ANKI_ENABLE_SIMD "Enable or not SIMD optimizations" ON)
 option(ANKI_ENABLE_SIMD "Enable or not SIMD optimizations" ON)
 
 
-if(ANKI_ENABLE_SIMD)
-	set(_ANKI_ENABLE_SIMD 1)
-else()
-	set(_ANKI_ENABLE_SIMD 0)
-endif()
-
 # Take a wild guess on the windowing system
 # Take a wild guess on the windowing system
 if(LINUX)
 if(LINUX)
 	set(_WIN_BACKEND "SDL")
 	set(_WIN_BACKEND "SDL")
@@ -99,10 +81,6 @@ else()
 	message(FATAL_ERROR "Couldn't determine the window backend. You need to specify it manually")
 	message(FATAL_ERROR "Couldn't determine the window backend. You need to specify it manually")
 endif()
 endif()
 
 
-# Extra directories
-set(ANKI_EXTRA_INCLUDE_DIRS CACHE STRING "Some extra include paths (Needed for some weird builds)")
-set(ANKI_EXTRA_LIB_DIRS CACHE STRING "Some extra lib paths (Needed for some weird builds)")
-
 # Valgrind
 # Valgrind
 option(ANKI_VALGRIND_HAPPY "Make valgrind happy" OFF)
 option(ANKI_VALGRIND_HAPPY "Make valgrind happy" OFF)
 
 
@@ -127,20 +105,17 @@ set(LINKER_FLAGS "")
 # When building AnKi define this special flag
 # When building AnKi define this special flag
 set(COMPILER_FLAGS "${COMPILER_FLAGS} -DANKI_BUILD ")
 set(COMPILER_FLAGS "${COMPILER_FLAGS} -DANKI_BUILD ")
 
 
-# address space
 if(NOT ANKI_CPU_ADDR_SPACE STREQUAL "0")
 if(NOT ANKI_CPU_ADDR_SPACE STREQUAL "0")
 	set(LINKER_FLAGS "${LINKER_FLAGS} -m${ANKI_CPU_ADDR_SPACE} ")
 	set(LINKER_FLAGS "${LINKER_FLAGS} -m${ANKI_CPU_ADDR_SPACE} ")
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -m${ANKI_CPU_ADDR_SPACE} ")
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -m${ANKI_CPU_ADDR_SPACE} ")
 endif()
 endif()
 
 
-add_definitions(-fno-exceptions)
+set(COMPILER_FLAGS "${COMPILER_FLAGS} -fno-exceptions ")
 
 
-# static libstdc++
 if(GCC)
 if(GCC)
-	#set(CXX_FLAGS "${CXX_FLAGS} -static-libstdc++ ")
+	set(CXX_FLAGS "${CXX_FLAGS} -static-libstdc++ ")
 endif()
 endif()
 
 
-# SSE
 if(ANKI_ENABLE_SIMD)
 if(ANKI_ENABLE_SIMD)
 	if(LINUX OR MACOS OR WINDOWS)
 	if(LINUX OR MACOS OR WINDOWS)
 		set(COMPILER_FLAGS "${COMPILER_FLAGS} -msse4 ")
 		set(COMPILER_FLAGS "${COMPILER_FLAGS} -msse4 ")
@@ -149,58 +124,41 @@ if(ANKI_ENABLE_SIMD)
 	endif()
 	endif()
 endif()
 endif()
 
 
-# Add debug
-if(ANKI_DEBUG_SYMBOLS)
-	set(COMPILER_FLAGS "${COMPILER_FLAGS} -g3 ")
-endif()
-
-if(ANKI_DEBUG)
-	if(GCC)
-		set(COMPILER_FLAGS "${COMPILER_FLAGS} -fstack-check ")
-	endif()
-else()
-	set(COMPILER_FLAGS "${COMPILER_FLAGS} -DNODEBUG ")
-	set(CXX_FLAGS "${CXX_FLAGS} -fno-rtti ")
-endif()
-
-# Add optimization flags
-if(ANKI_OPTIMIZE)
-	set(COMPILER_FLAGS "${COMPILER_FLAGS} -ffast-math -O3 ")
-
-	# Add this because Android compiler complains
-	if(ANDROID)
-		set(COMPILER_FLAGS "${COMPILER_FLAGS} -fno-data-sections ")
-	endif()
-else()
-	set(COMPILER_FLAGS "${COMPILER_FLAGS} -O0 ")
-endif()
-
-# LTO
 if(ANKI_LTO)
 if(ANKI_LTO)
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto ")
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto ")
 	set(LINKER_FLAGS "${LINKER_FLAGS} -flto ")
 	set(LINKER_FLAGS "${LINKER_FLAGS} -flto ")
 endif()
 endif()
 
 
-# Valgrind hacks
-if(ANKI_VALGRIND_HAPPY)
-	add_definitions("-DGLIBCXX_FORCE_NEW")
-endif()
-
-# Disable GLU in GLEW
-add_definitions(-DGLEW_NO_GLU)
-
-# Strip
 if(ANKI_STRIP)
 if(ANKI_STRIP)
 	set(LINKER_FLAGS "${LINKER_FLAGS} -s ")
 	set(LINKER_FLAGS "${LINKER_FLAGS} -s ")
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -s ")
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -s ")
 endif()
 endif()
 
 
-include_directories(${ANKI_EXTRA_INCLUDE_DIRS})
-link_directories(${ANKI_EXTRA_LIB_DIRS})
+add_definitions(-DGLEW_NO_GLU)
+add_definitions(-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
+
+if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
+	set(COMPILER_FLAGS "${COMPILER_FLAGS} -O3 -DNDEBUG ")
+
+	set(CMAKE_CXX_FLAGS_RELEASE "")
+	set(CMAKE_C_FLAGS_RELEASE "")
+elseif(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDbgInfo")
+	set(COMPILER_FLAGS "${COMPILER_FLAGS} -O3 -g3 ")
+
+	set(CMAKE_CXX_FLAGS_RELWITHDBGINFO "")
+	set(CMAKE_C_FLAGS_RELWITHDBGINFO "")
+elseif(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+	set(COMPILER_FLAGS "${COMPILER_FLAGS} -O0 -g3 ")
+
+	set(CMAKE_CXX_FLAGS_DEBUG "")
+	set(CMAKE_C_FLAGS_DEBUG "")
+else()
+	message(FATAL_ERROR "Wrong CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+endif()
 
 
 # Set the flags to cmake now
 # Set the flags to cmake now
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS} ${COMPILER_FLAGS}")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CXX_FLAGS} ${COMPILER_FLAGS}")
+set(CMAKE_C_FLAGS "${COMPILER_FLAGS}")
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
 
 
 ################################################################################
 ################################################################################
@@ -215,8 +173,6 @@ message("++ Lib install dir: ${LIB_INSTALL_DIR}")
 ################################################################################
 ################################################################################
 # Thirdparty                                                                   #
 # Thirdparty                                                                   #
 ################################################################################
 ################################################################################
-include(ExternalProject)
-
 set(ANKI_EXTERN_SUB_DIRS tinyxml2 lua z)
 set(ANKI_EXTERN_SUB_DIRS tinyxml2 lua z)
 
 
 if((LINUX OR MACOS OR WINDOWS) AND GL)
 if((LINUX OR MACOS OR WINDOWS) AND GL)
@@ -233,66 +189,32 @@ endif()
 
 
 # SDL
 # SDL
 if(SDL)
 if(SDL)
-	ExternalProject_Add(
-		SDL2_PROJECT
-		DOWNLOAD_COMMAND ""
-		PREFIX "${CMAKE_CURRENT_BINARY_DIR}/sdl2_build"
-		SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/SDL2"
-		CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/sdl2_build -DSDL_SHARED=OFF -DSDL_STATIC=ON 
-		-DCMAKE_BUILD_TYPE=Release -DDIRECTX=OFF -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DVIDEO_MIR=OFF 
-		-DVIDEO_WAYLAND=OFF -DSNDIO=OFF -DVIDEO_OPENGLES=OFF)
-
-	ExternalProject_Get_Property(SDL2_PROJECT install_dir)
-	set(SDL2_INSTALL_DIR ${install_dir})
-
-	defineStaticExternalLibrary(SDL2_PROJECT SDL2_LIB "${SDL2_INSTALL_DIR}/lib/libSDL2${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	message("++ Configuring SDL2")
+	add_subdirectory(thirdparty/SDL2)
+	message("++ End configuring SDL2")
+
+	# Include first the build directory. 
+	set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/SDL2/include" 
+		"${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/SDL2/include")
 else()
 else()
-	set(SDL2_INSTALL_DIR "")
+	set(SDL2_INCLUDE_DIRS "")
 endif()
 endif()
 
 
 # Newton
 # Newton
-ExternalProject_Add(
-	NEWTON_PROJECT
-	DOWNLOAD_COMMAND ""
-	PREFIX "${CMAKE_CURRENT_BINARY_DIR}/newton_build"
-	SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/newton"
-	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/newton_build -DCMAKE_BUILD_TYPE=Release 
-	-DNEWTON_DEMOS_SANDBOX=OFF -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
-
-defineStaticExternalLibrary(NEWTON_PROJECT NEWTON_LIB "${CMAKE_CURRENT_BINARY_DIR}/newton_build/src/NEWTON_PROJECT-build/lib/libNewton${CMAKE_STATIC_LIBRARY_SUFFIX}")
-defineStaticExternalLibrary(NEWTON_PROJECT NEWTON_JOINTS_LIB "${CMAKE_CURRENT_BINARY_DIR}/newton_build/src/NEWTON_PROJECT-build/lib/libdCustomJoints${CMAKE_STATIC_LIBRARY_SUFFIX}")
-defineStaticExternalLibrary(NEWTON_PROJECT NEWTON_CONTAINERS_LIB "${CMAKE_CURRENT_BINARY_DIR}/newton_build/src/NEWTON_PROJECT-build/lib/libdContainers${CMAKE_STATIC_LIBRARY_SUFFIX}")
-defineStaticExternalLibrary(NEWTON_PROJECT NEWTON_MATH_LIB "${CMAKE_CURRENT_BINARY_DIR}/newton_build/src/NEWTON_PROJECT-build/lib/libdMath${CMAKE_STATIC_LIBRARY_SUFFIX}")
+message("++ Configuring Newton")
+add_subdirectory(thirdparty/newton)
+message("++ End configuring Newton")
 
 
 # freetype
 # freetype
-ExternalProject_Add(
-	FREETYPE_PROJECT
-	DOWNLOAD_COMMAND ""
-	PREFIX "${CMAKE_CURRENT_BINARY_DIR}/freetype_build"
-	SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/freetype"
-	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/freetype_build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
-
-ExternalProject_Get_Property(FREETYPE_PROJECT install_dir)
-set(FREETYPE_INSTALL_DIR ${install_dir})
-defineStaticExternalLibrary(FREETYPE_PROJECT FREETYPE_LIB "${FREETYPE_INSTALL_DIR}/lib/libfreetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
+message("++ Configuring freetype")
+add_subdirectory(thirdparty/freetype)
+message("++ End configuring freetype")
 
 
 # glslang
 # glslang
 if(VULKAN)
 if(VULKAN)
-	ExternalProject_Add(
-		GLSLANG_PROJECT
-		DOWNLOAD_COMMAND ""
-		PREFIX "${CMAKE_CURRENT_BINARY_DIR}/glslang_build"
-		SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glslang"
-		CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/glslang_build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
-
-	ExternalProject_Get_Property(GLSLANG_PROJECT install_dir)
-	set(GLSLANG_INSTALL_DIR ${install_dir})
-
-	defineStaticExternalLibrary(GLSLANG_PROJECT GLSLANG_LIB "${GLSLANG_INSTALL_DIR}/lib/libglslang${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	defineStaticExternalLibrary(GLSLANG_PROJECT SPIRV_LIB "${GLSLANG_INSTALL_DIR}/lib/libSPIRV${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	defineStaticExternalLibrary(GLSLANG_PROJECT OSD_LIB "${GLSLANG_INSTALL_DIR}/lib/libOSDependent${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	defineStaticExternalLibrary(GLSLANG_PROJECT GLC_LIB "${GLSLANG_INSTALL_DIR}/lib/libOGLCompiler${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	defineStaticExternalLibrary(GLSLANG_PROJECT HLSL_LIB "${GLSLANG_INSTALL_DIR}/lib/libHLSL${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	message("++ Configuring glslang")
+	add_subdirectory(thirdparty/glslang)
+	message("++ End configuring glslang")
 endif()
 endif()
 
 
 foreach(TMP ${ANKI_EXTERN_SUB_DIRS})
 foreach(TMP ${ANKI_EXTERN_SUB_DIRS})
@@ -336,10 +258,29 @@ set(ANKI_VERSION_MAJOR 0)
 set(ANKI_VERSION_MINOR 1)
 set(ANKI_VERSION_MINOR 1)
 message("++ AnKi version: ${ANKI_VERSION_MAJOR}.${ANKI_VERSION_MINOR}")
 message("++ AnKi version: ${ANKI_VERSION_MAJOR}.${ANKI_VERSION_MINOR}")
 
 
-if(ANKI_DEBUG)
-	set(ANKI_DEBUG 1)
+if(ANKI_EXTRA_CHECKS)
+	set(_ANKI_EXTRA_CHECKS 1)
 else()
 else()
-	set(ANKI_DEBUG 0)
+	set(_ANKI_EXTRA_CHECKS 0)
+endif()
+
+if(ANKI_ENABLE_SIMD)
+	set(_ANKI_ENABLE_SIMD 1)
+else()
+	set(_ANKI_ENABLE_SIMD 0)
+endif()
+
+if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+	set(ANKI_DEBUG_SYMBOLS 1)
+	set(ANKI_OPTIMIZE 0)
+elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
+	set(ANKI_DEBUG_SYMBOLS 0)
+	set(ANKI_OPTIMIZE 1)
+elseif(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDbgInfo")
+	set(ANKI_DEBUG_SYMBOLS 1)
+	set(ANKI_OPTIMIZE 1)
+else()
+	message(FATAL_ERROR "Wrong CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
 endif()
 endif()
 
 
 configure_file("src/anki/Config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/anki/Config.h")
 configure_file("src/anki/Config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/anki/Config.h")
@@ -350,8 +291,9 @@ include_directories("src"
 	"thirdparty/tinyxml2/include" 
 	"thirdparty/tinyxml2/include" 
 	"thirdparty/lua" 
 	"thirdparty/lua" 
 	"thirdparty/z" 
 	"thirdparty/z" 
-	"${SDL2_INSTALL_DIR}/include/SDL2/" 
-	"${FREETYPE_INSTALL_DIR}/include/freetype2/" 
+	"${SDL2_INCLUDE_DIRS}"
+	"thirdparty/freetype/include" 
+	"${CMAKE_CURRENT_BINARY_DIR}/thirdparty/freetype/include/freetype2"
 	"thirdparty/newton/coreLibrary_300/source/newton" 
 	"thirdparty/newton/coreLibrary_300/source/newton" 
 	"thirdparty/newton/packages/dCustomJoints"
 	"thirdparty/newton/packages/dCustomJoints"
 	"thirdparty/newton/packages/dContainers" 
 	"thirdparty/newton/packages/dContainers" 
@@ -372,7 +314,7 @@ if(ANDROID)
 endif()
 endif()
 
 
 # AnKi compiler flags (Mainly warnings)
 # AnKi compiler flags (Mainly warnings)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -W -Wextra -Wstrict-aliasing -Wwrite-strings -Wunused -Wunused-variable -Wno-unused-parameter -Wundef -Wno-ignored-attributes -std=c++11 ")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -W -Wextra -Wstrict-aliasing -Wwrite-strings -Wunused -Wunused-variable -Wno-unused-parameter -Wundef -Wno-ignored-attributes -std=c++11")
 
 
 # Set platform specific
 # Set platform specific
 if(LINUX)
 if(LINUX)
@@ -408,14 +350,8 @@ else()
 	message(FATAL_ERROR "Unhandled case")
 	message(FATAL_ERROR "Unhandled case")
 endif()
 endif()
 
 
-if(SDL)
-	link_directories(${SDL2_INSTALL_DIR}/lib)
-endif()
-
 link_directories(${FREETYPE_INSTALL_DIR}/lib)
 link_directories(${FREETYPE_INSTALL_DIR}/lib)
 
 
-add_definitions(-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
-
 # Add anki sub libraries
 # Add anki sub libraries
 set(ANKI_SUB_DIRS core script renderer scene ui event input physics resource misc gr collision math util)
 set(ANKI_SUB_DIRS core script renderer scene ui event input physics resource misc gr collision math util)
 set(ANKI_LIBS "")
 set(ANKI_LIBS "")
@@ -427,7 +363,7 @@ endforeach()
 
 
 add_library(anki src/anki/Dummy.cpp "${_SYS_SRC}")
 add_library(anki src/anki/Dummy.cpp "${_SYS_SRC}")
 
 
-target_link_libraries(anki ${ANKI_LIBS} ankitinyxml2 ankilua ankiz FREETYPE_LIB ${_SYS})
+target_link_libraries(anki ${ANKI_LIBS} ankitinyxml2 ankilua ankiz ${_SYS})
 
 
 ################################################################################
 ################################################################################
 # AnKi extra                                                                   #
 # AnKi extra                                                                   #

+ 1 - 1
README.md

@@ -40,7 +40,7 @@ To build the release version:
 	$cd path/to/anki
 	$cd path/to/anki
 	$cd mkdir build
 	$cd mkdir build
 	$cd ./build
 	$cd ./build
-	$cmake ..
+	$cmake .. -DCMAKE_BUILD_TYPE=Release
 	$make
 	$make
 
 
 To view and configure the build options you can use ccmake tool or other similar tool:
 To view and configure the build options you can use ccmake tool or other similar tool:

+ 3 - 2
src/anki/Config.h.cmake

@@ -12,8 +12,9 @@
 #define ANKI_VERSION_MAJOR ${ANKI_VERSION_MAJOR}
 #define ANKI_VERSION_MAJOR ${ANKI_VERSION_MAJOR}
 #define ANKI_REVISION ${ANKI_REVISION}
 #define ANKI_REVISION ${ANKI_REVISION}
 
 
-#define ANKI_DEBUG ${ANKI_DEBUG}
-#define ANKI_ASSERTIONS ANKI_DEBUG
+#define ANKI_EXTRA_CHECKS ${_ANKI_EXTRA_CHECKS}
+#define ANKI_DEBUG_SYMBOLS ${ANKI_DEBUG_SYMBOLS}
+#define ANKI_OPTIMIZE ${ANKI_OPTIMIZE}
 
 
 // Operating system
 // Operating system
 #define ANKI_OS_LINUX 1
 #define ANKI_OS_LINUX 1

+ 1 - 1
src/anki/collision/GjkEpaInternal.h

@@ -76,7 +76,7 @@ public:
 		m_dist = -1.0;
 		m_dist = -1.0;
 		m_originInside = 2;
 		m_originInside = 2;
 		m_dead = false;
 		m_dead = false;
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 		m_idx[0] = m_idx[1] = m_idx[2] = MAX_U32;
 		m_idx[0] = m_idx[1] = m_idx[2] = MAX_U32;
 #endif
 #endif
 	}
 	}

+ 15 - 4
src/anki/core/App.cpp

@@ -152,15 +152,26 @@ Error App::initInternal(const ConfigSet& config_, AllocAlignedCallback allocCb,
 
 
 	// Print a message
 	// Print a message
 	const char* buildType =
 	const char* buildType =
-#if !ANKI_DEBUG
-		"release";
+#if ANKI_OPTIMIZE
+		"optimized, "
 #else
 #else
-		"debug";
+		"NOT optimized, "
+#endif
+#if ANKI_DEBUG_SYMBOLS
+		"dbg symbols, "
+#else
+		"NO dbg symbols, "
+#endif
+#if ANKI_EXTRA_CHECKS
+		"extra checks";
+#else
+		"NO extra checks";
 #endif
 #endif
 
 
 	ANKI_LOGI("Initializing application ("
 	ANKI_LOGI("Initializing application ("
 			  "version %u.%u, "
 			  "version %u.%u, "
-			  "build %s %s, "
+			  "%s, "
+			  "date %s, "
 			  "commit %s)...",
 			  "commit %s)...",
 		ANKI_VERSION_MAJOR,
 		ANKI_VERSION_MAJOR,
 		ANKI_VERSION_MINOR,
 		ANKI_VERSION_MINOR,

+ 1 - 1
src/anki/core/CMakeLists.txt

@@ -11,5 +11,5 @@ add_library(ankicore ${ANKI_CORE_SOURCES})
 target_link_libraries(ankicore ankiscript ankirenderer ankiscene ankiresource ankiinput ankimisc ankiutil)
 target_link_libraries(ankicore ankiscript ankirenderer ankiscene ankiresource ankiinput ankimisc ankiutil)
 
 
 if(SDL)
 if(SDL)
-	target_link_libraries(ankicore SDL2_LIB)
+	target_link_libraries(ankicore SDL2-static)
 endif()
 endif()

+ 1 - 1
src/anki/gr/CMakeLists.txt

@@ -5,7 +5,7 @@ if(GL)
 	set(EXTRA_LIBS "")
 	set(EXTRA_LIBS "")
 else()
 else()
 	set(GR_BACKEND "vulkan")
 	set(GR_BACKEND "vulkan")
-	set(EXTRA_LIBS GLSLANG_LIB SPIRV_LIB OSD_LIB GLC_LIB HLSL_LIB ankispirvcross)
+	set(EXTRA_LIBS glslang SPIRV HLSL OGLCompiler OSDependent ankispirvcross)
 endif()
 endif()
 
 
 file(GLOB ANKI_GR_BACKEND_SOURCES ${GR_BACKEND}/*.cpp)
 file(GLOB ANKI_GR_BACKEND_SOURCES ${GR_BACKEND}/*.cpp)

+ 2 - 2
src/anki/gr/gl/Buffer.cpp

@@ -76,7 +76,7 @@ void* Buffer::map(PtrSize offset, PtrSize range, BufferMapAccessBit access)
 	U8* ptr = static_cast<U8*>(m_impl->m_persistentMapping);
 	U8* ptr = static_cast<U8*>(m_impl->m_persistentMapping);
 	ptr += offset;
 	ptr += offset;
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	ANKI_ASSERT(!m_impl->m_mapped);
 	ANKI_ASSERT(!m_impl->m_mapped);
 	m_impl->m_mapped = true;
 	m_impl->m_mapped = true;
 #endif
 #endif
@@ -86,7 +86,7 @@ void* Buffer::map(PtrSize offset, PtrSize range, BufferMapAccessBit access)
 
 
 void Buffer::unmap()
 void Buffer::unmap()
 {
 {
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	ANKI_ASSERT(m_impl->m_mapped);
 	ANKI_ASSERT(m_impl->m_mapped);
 	m_impl->m_mapped = false;
 	m_impl->m_mapped = false;
 #endif
 #endif

+ 1 - 1
src/anki/gr/gl/BufferImpl.h

@@ -22,7 +22,7 @@ public:
 	BufferUsageBit m_usage = BufferUsageBit::NONE;
 	BufferUsageBit m_usage = BufferUsageBit::NONE;
 	BufferMapAccessBit m_access = BufferMapAccessBit::NONE;
 	BufferMapAccessBit m_access = BufferMapAccessBit::NONE;
 	GLenum m_target = GL_NONE; ///< A guess
 	GLenum m_target = GL_NONE; ///< A guess
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	Bool m_mapped = false;
 	Bool m_mapped = false;
 #endif
 #endif
 
 

+ 1 - 1
src/anki/gr/gl/CommandBuffer.cpp

@@ -42,7 +42,7 @@ void CommandBuffer::init(CommandBufferInitInfo& inf)
 	m_impl.reset(getAllocator().newInstance<CommandBufferImpl>(&getManager()));
 	m_impl.reset(getAllocator().newInstance<CommandBufferImpl>(&getManager()));
 	m_impl->init(inf);
 	m_impl->init(inf);
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	m_impl->m_state.m_secondLevel = !!(inf.m_flags & CommandBufferFlag::SECOND_LEVEL);
 	m_impl->m_state.m_secondLevel = !!(inf.m_flags & CommandBufferFlag::SECOND_LEVEL);
 #endif
 #endif
 
 

+ 3 - 4
src/anki/gr/gl/CommandBufferImpl.cpp

@@ -35,11 +35,10 @@ void CommandBufferImpl::destroy()
 {
 {
 	ANKI_TRACE_START_EVENT(GL_CMD_BUFFER_DESTROY);
 	ANKI_TRACE_START_EVENT(GL_CMD_BUFFER_DESTROY);
 
 
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	if(!m_executed && m_firstCommand)
 	if(!m_executed && m_firstCommand)
 	{
 	{
-		ANKI_GL_LOGW("Chain contains commands but never executed. "
-					 "This should only happen on exceptions");
+		ANKI_GL_LOGW("Chain contains commands but never executed. This should only happen on exceptions");
 	}
 	}
 #endif
 #endif
 
 
@@ -63,7 +62,7 @@ Error CommandBufferImpl::executeAllCommands()
 {
 {
 	ANKI_ASSERT(m_firstCommand != nullptr && "Empty command buffer");
 	ANKI_ASSERT(m_firstCommand != nullptr && "Empty command buffer");
 	ANKI_ASSERT(m_lastCommand != nullptr && "Empty command buffer");
 	ANKI_ASSERT(m_lastCommand != nullptr && "Empty command buffer");
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	m_executed = true;
 	m_executed = true;
 #endif
 #endif
 
 

+ 2 - 2
src/anki/gr/gl/CommandBufferImpl.h

@@ -49,7 +49,7 @@ public:
 	Bool8 m_immutable = false;
 	Bool8 m_immutable = false;
 	CommandBufferFlag m_flags;
 	CommandBufferFlag m_flags;
 
 
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	Bool8 m_executed = false;
 	Bool8 m_executed = false;
 #endif
 #endif
 
 
@@ -91,7 +91,7 @@ public:
 	/// Fake that it's been executed
 	/// Fake that it's been executed
 	void makeExecuted()
 	void makeExecuted()
 	{
 	{
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 		m_executed = true;
 		m_executed = true;
 #endif
 #endif
 	}
 	}

+ 1 - 1
src/anki/gr/gl/Error.h

@@ -15,7 +15,7 @@ namespace anki
 
 
 // Enable the exception on debug. Calling glGetError calls serialization
 // Enable the exception on debug. Calling glGetError calls serialization
 
 
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 
 
 /// The function exits if there is an OpenGL error. Use it with the
 /// The function exits if there is an OpenGL error. Use it with the
 /// ANKI_CHECK_GL_ERROR macro
 /// ANKI_CHECK_GL_ERROR macro

+ 1 - 1
src/anki/gr/gl/GrManagerImpl.h

@@ -5,7 +5,7 @@
 
 
 #pragma once
 #pragma once
 
 
-#include <anki/gr/Common.h>
+#include <anki/gr/gl/Common.h>
 
 
 namespace anki
 namespace anki
 {
 {

+ 1 - 1
src/anki/gr/gl/ShaderImpl.cpp

@@ -11,7 +11,7 @@
 #include <anki/util/StringList.h>
 #include <anki/util/StringList.h>
 #include <anki/util/Logger.h>
 #include <anki/util/Logger.h>
 
 
-#define ANKI_DUMP_SHADERS ANKI_DEBUG
+#define ANKI_DUMP_SHADERS ANKI_EXTRA_CHECKS
 
 
 #if ANKI_DUMP_SHADERS
 #if ANKI_DUMP_SHADERS
 #include <anki/util/File.h>
 #include <anki/util/File.h>

+ 1 - 1
src/anki/gr/gl/StateTracker.h

@@ -28,7 +28,7 @@ public:
 	/// If it's false then there might be unset state.
 	/// If it's false then there might be unset state.
 	Bool8 m_mayContainUnsetState = true;
 	Bool8 m_mayContainUnsetState = true;
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	Bool8 m_secondLevel = false;
 	Bool8 m_secondLevel = false;
 #endif
 #endif
 
 

+ 1 - 1
src/anki/gr/vulkan/BufferImpl.cpp

@@ -144,7 +144,7 @@ void* BufferImpl::map(PtrSize offset, PtrSize range, BufferMapAccessBit access)
 	void* ptr = getGrManagerImpl().getGpuMemoryManager().getMappedAddress(m_memHandle);
 	void* ptr = getGrManagerImpl().getGpuMemoryManager().getMappedAddress(m_memHandle);
 	ANKI_ASSERT(ptr);
 	ANKI_ASSERT(ptr);
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	m_mapped = true;
 	m_mapped = true;
 #endif
 #endif
 
 

+ 2 - 2
src/anki/gr/vulkan/BufferImpl.h

@@ -34,7 +34,7 @@ public:
 		ANKI_ASSERT(isCreated());
 		ANKI_ASSERT(isCreated());
 		ANKI_ASSERT(m_mapped);
 		ANKI_ASSERT(m_mapped);
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		m_mapped = false;
 		m_mapped = false;
 #endif
 #endif
 		// TODO Flush or invalidate caches
 		// TODO Flush or invalidate caches
@@ -72,7 +72,7 @@ private:
 	VkMemoryPropertyFlags m_memoryFlags = 0;
 	VkMemoryPropertyFlags m_memoryFlags = 0;
 	BufferUsageBit m_usage = BufferUsageBit::NONE;
 	BufferUsageBit m_usage = BufferUsageBit::NONE;
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	Bool8 m_mapped = false;
 	Bool8 m_mapped = false;
 #endif
 #endif
 
 

+ 1 - 1
src/anki/gr/vulkan/CommandBufferImpl.h

@@ -176,7 +176,7 @@ private:
 	List<ShaderProgramPtr> m_progs;
 	List<ShaderProgramPtr> m_progs;
 /// @}
 /// @}
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	// Debug stuff
 	// Debug stuff
 	Bool8 m_insideRenderPass = false;
 	Bool8 m_insideRenderPass = false;
 #endif
 #endif

+ 1 - 1
src/anki/gr/vulkan/GrManagerImpl.h

@@ -19,7 +19,7 @@
 namespace anki
 namespace anki
 {
 {
 
 
-#define ANKI_GR_MANAGER_DEBUG_MEMMORY ANKI_DEBUG
+#define ANKI_GR_MANAGER_DEBUG_MEMMORY ANKI_EXTRA_CHECKS
 
 
 // Forward
 // Forward
 class TextureFallbackUploader;
 class TextureFallbackUploader;

+ 1 - 1
src/anki/gr/vulkan/ShaderImpl.cpp

@@ -10,7 +10,7 @@
 #include <glslang/SPIRV/GlslangToSpv.h>
 #include <glslang/SPIRV/GlslangToSpv.h>
 #include <SPIRV-Cross/spirv_cross.hpp>
 #include <SPIRV-Cross/spirv_cross.hpp>
 
 
-#define ANKI_DUMP_SHADERS ANKI_DEBUG
+#define ANKI_DUMP_SHADERS ANKI_EXTRA_CHECKS
 
 
 #if ANKI_DUMP_SHADERS
 #if ANKI_DUMP_SHADERS
 #include <anki/util/File.h>
 #include <anki/util/File.h>

+ 1 - 1
src/anki/math/Functions.cpp

@@ -18,7 +18,7 @@ static Scalar polynomialSinQuadrant(const Scalar a)
 template<typename Scalar>
 template<typename Scalar>
 static void sinCosInternal(const Scalar a_, Scalar& sina, Scalar& cosa)
 static void sinCosInternal(const Scalar a_, Scalar& sina, Scalar& cosa)
 {
 {
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	sina = sin(a_);
 	sina = sin(a_);
 	cosa = cos(a_);
 	cosa = cos(a_);
 #else
 #else

+ 1 - 1
src/anki/physics/CMakeLists.txt

@@ -2,5 +2,5 @@ file(GLOB ANKI_PHYS_SOURCES *.cpp)
 file(GLOB ANKI_PHYS_HEADERS *.h)
 file(GLOB ANKI_PHYS_HEADERS *.h)
 
 
 add_library(ankiphysics ${ANKI_PHYS_SOURCES} ${ANKI_PHYS_HEADERS})
 add_library(ankiphysics ${ANKI_PHYS_SOURCES} ${ANKI_PHYS_HEADERS})
-target_link_libraries(ankiphysics NEWTON_LIB NEWTON_JOINTS_LIB NEWTON_CONTAINERS_LIB NEWTON_MATH_LIB)
+target_link_libraries(ankiphysics NewtonStatic dCustomJoints dContainers dMath)
 
 

+ 1 - 1
src/anki/physics/PhysicsCollisionShape.cpp

@@ -79,7 +79,7 @@ Error PhysicsTriangleSoup::create(PhysicsCollisionShapeInitInfo& init,
 		NewtonTreeCollisionAddFace(m_shape, 3, &facePos[0][0], sizeof(Vec3), 0);
 		NewtonTreeCollisionAddFace(m_shape, 3, &facePos[0][0], sizeof(Vec3), 0);
 	}
 	}
 
 
-	const I optimize = !ANKI_DEBUG;
+	const I optimize = 1;
 	NewtonTreeCollisionEndBuild(m_shape, optimize);
 	NewtonTreeCollisionEndBuild(m_shape, optimize);
 
 
 	return ErrorCode::NONE;
 	return ErrorCode::NONE;

+ 1 - 1
src/anki/renderer/Ms.cpp

@@ -56,7 +56,7 @@ Error Ms::createRt()
 		m_rt2);
 		m_rt2);
 
 
 	AttachmentLoadOperation loadop = AttachmentLoadOperation::DONT_CARE;
 	AttachmentLoadOperation loadop = AttachmentLoadOperation::DONT_CARE;
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	loadop = AttachmentLoadOperation::CLEAR;
 	loadop = AttachmentLoadOperation::CLEAR;
 #endif
 #endif
 
 

+ 2 - 2
src/anki/renderer/Sm.cpp

@@ -392,7 +392,7 @@ void Sm::prepareBuildCommandBuffers(RenderingContext& ctx)
 		ctx.m_sm.m_spotCommandBuffers.create(spotCastersCount * m_r->getThreadPool().getThreadsCount());
 		ctx.m_sm.m_spotCommandBuffers.create(spotCastersCount * m_r->getThreadPool().getThreadsCount());
 
 
 		ctx.m_sm.m_spotCacheIndices.create(spotCastersCount);
 		ctx.m_sm.m_spotCacheIndices.create(spotCastersCount);
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		memset(&ctx.m_sm.m_spotCacheIndices[0], 0xFF, sizeof(ctx.m_sm.m_spotCacheIndices[0]) * spotCastersCount);
 		memset(&ctx.m_sm.m_spotCacheIndices[0], 0xFF, sizeof(ctx.m_sm.m_spotCacheIndices[0]) * spotCastersCount);
 #endif
 #endif
 
 
@@ -415,7 +415,7 @@ void Sm::prepareBuildCommandBuffers(RenderingContext& ctx)
 		ctx.m_sm.m_omniCommandBuffers.create(omniCastersCount * 6 * m_r->getThreadPool().getThreadsCount());
 		ctx.m_sm.m_omniCommandBuffers.create(omniCastersCount * 6 * m_r->getThreadPool().getThreadsCount());
 
 
 		ctx.m_sm.m_omniCacheIndices.create(omniCastersCount);
 		ctx.m_sm.m_omniCacheIndices.create(omniCastersCount);
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		memset(&ctx.m_sm.m_omniCacheIndices[0], 0xFF, sizeof(ctx.m_sm.m_omniCacheIndices[0]) * omniCastersCount);
 		memset(&ctx.m_sm.m_omniCacheIndices[0], 0xFF, sizeof(ctx.m_sm.m_omniCacheIndices[0]) * omniCastersCount);
 #endif
 #endif
 
 

+ 1 - 1
src/anki/scene/ReflectionProxyComponent.cpp

@@ -36,7 +36,7 @@ Error ReflectionProxyComponent::update(SceneNode& node, F32 prevTime, F32 crntTi
 			// Update the plane
 			// Update the plane
 			face.m_plane.setFrom3Points(a, b, c);
 			face.m_plane.setFrom3Points(a, b, c);
 
 
-#if ANKI_ASSERTIONS == 1
+#if ANKI_EXTRA_CHECKS == 1
 			// Make sure that all points are co-planar
 			// Make sure that all points are co-planar
 			Vec4 n0 = (b - a).cross(c - b);
 			Vec4 n0 = (b - a).cross(c - b);
 			Vec4 n1 = (c - b).cross(d - c);
 			Vec4 n1 = (c - b).cross(d - c);

+ 1 - 1
src/anki/scene/SceneNode.cpp

@@ -91,7 +91,7 @@ void SceneNode::addComponent(SceneComponent* comp, Bool transferOwnership)
 {
 {
 	ANKI_ASSERT(comp);
 	ANKI_ASSERT(comp);
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	Error err = iterateComponents([&](const SceneComponent& bcomp) -> Error {
 	Error err = iterateComponents([&](const SceneComponent& bcomp) -> Error {
 		ANKI_ASSERT(comp != &bcomp);
 		ANKI_ASSERT(comp != &bcomp);
 		return ErrorCode::NONE;
 		return ErrorCode::NONE;

+ 1 - 1
src/anki/scene/Sector.cpp

@@ -326,7 +326,7 @@ void Sector::tryRemoveSpatialComponent(SpatialComponent* sp)
 	}
 	}
 	else
 	else
 	{
 	{
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		ANKI_ASSERT(findSpatialComponent(sp) == m_spatials.getEnd());
 		ANKI_ASSERT(findSpatialComponent(sp) == m_spatials.getEnd());
 #endif
 #endif
 	}
 	}

+ 1 - 1
src/anki/ui/CMakeLists.txt

@@ -1,4 +1,4 @@
 file(GLOB ANKI_UI_SOURCES *.cpp)
 file(GLOB ANKI_UI_SOURCES *.cpp)
 
 
 add_library(ankiui ${ANKI_UI_SOURCES})
 add_library(ankiui ${ANKI_UI_SOURCES})
-target_link_libraries(ankiui ankiresource FREETYPE_LIB)
+target_link_libraries(ankiui ankiresource freetype)

+ 1 - 1
src/anki/util/Assert.cpp

@@ -14,7 +14,7 @@
 namespace anki
 namespace anki
 {
 {
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 
 
 void akassert(const char* exprTxt, const char* file, int line, const char* func)
 void akassert(const char* exprTxt, const char* file, int line, const char* func)
 {
 {

+ 1 - 1
src/anki/util/Assert.h

@@ -8,7 +8,7 @@
 #include <anki/Config.h>
 #include <anki/Config.h>
 
 
 /// Assertion. Print an error and stop the debugger (if it runs through a debugger) and then abort.
 /// Assertion. Print an error and stop the debugger (if it runs through a debugger) and then abort.
-#if !ANKI_ASSERTIONS
+#if !ANKI_EXTRA_CHECKS
 #define ANKI_ASSERT(x) ((void)0)
 #define ANKI_ASSERT(x) ((void)0)
 #define ANKI_ASSERTS_ENABLED 0
 #define ANKI_ASSERTS_ENABLED 0
 #else
 #else

+ 1 - 1
src/anki/util/DynamicArray.h

@@ -345,7 +345,7 @@ public:
 
 
 	~WeakArray()
 	~WeakArray()
 	{
 	{
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		m_data = nullptr;
 		m_data = nullptr;
 		m_size = 0;
 		m_size = 0;
 #endif
 #endif

+ 1 - 1
src/anki/util/Functions.h

@@ -166,7 +166,7 @@ struct RemovePointer<T*>
 template<typename To, typename From>
 template<typename To, typename From>
 To staticCastPtr(From from)
 To staticCastPtr(From from)
 {
 {
-#if ANKI_DEBUG == 1
+#if ANKI_EXTRA_CHECKS
 	To ptr = dynamic_cast<To>(from);
 	To ptr = dynamic_cast<To>(from);
 	ANKI_ASSERT(ptr != nullptr);
 	ANKI_ASSERT(ptr != nullptr);
 	return ptr;
 	return ptr;

+ 2 - 2
src/anki/util/Memory.cpp

@@ -17,7 +17,7 @@
 namespace anki
 namespace anki
 {
 {
 
 
-#define ANKI_MEM_SIGNATURES ANKI_DEBUG
+#define ANKI_MEM_SIGNATURES ANKI_EXTRA_CHECKS
 
 
 #if ANKI_MEM_SIGNATURES
 #if ANKI_MEM_SIGNATURES
 using Signature = U32;
 using Signature = U32;
@@ -40,7 +40,7 @@ static Signature computeSignature(void* ptr)
 template<typename TPtr, typename TSize>
 template<typename TPtr, typename TSize>
 static void invalidateMemory(TPtr ptr, TSize size)
 static void invalidateMemory(TPtr ptr, TSize size)
 {
 {
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	memset(static_cast<void*>(ptr), 0xCC, size);
 	memset(static_cast<void*>(ptr), 0xCC, size);
 #endif
 #endif
 }
 }

+ 1 - 1
src/anki/util/Memory.h

@@ -22,7 +22,7 @@ class SpinLock;
 /// @addtogroup util_memory
 /// @addtogroup util_memory
 /// @{
 /// @{
 
 
-#define ANKI_MEM_USE_SIGNATURES ANKI_DEBUG
+#define ANKI_MEM_USE_SIGNATURES ANKI_EXTRA_CHECKS
 
 
 /// Allocate aligned memory
 /// Allocate aligned memory
 void* mallocAligned(PtrSize size, PtrSize alignmentBytes);
 void* mallocAligned(PtrSize size, PtrSize alignmentBytes);

+ 1 - 1
src/anki/util/StdTypes.h

@@ -179,7 +179,7 @@ private:
 	} while(0)
 	} while(0)
 
 
 /// Macro to nuliffy a pointer on debug builds.
 /// Macro to nuliffy a pointer on debug builds.
-#if ANKI_DEBUG == 1
+#if ANKI_EXTRA_CHECKS
 #define ANKI_DBG_NULLIFY = {}
 #define ANKI_DBG_NULLIFY = {}
 #else
 #else
 #define ANKI_DBG_NULLIFY
 #define ANKI_DBG_NULLIFY

+ 1 - 1
src/anki/util/Thread.h

@@ -75,7 +75,7 @@ private:
 	ThreadCallback m_callback = nullptr; ///< The callback
 	ThreadCallback m_callback = nullptr; ///< The callback
 	void* m_userData = nullptr; ///< The user date to pass to the callback
 	void* m_userData = nullptr; ///< The user date to pass to the callback
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	Bool8 m_started = false;
 	Bool8 m_started = false;
 #endif
 #endif
 };
 };

+ 1 - 1
src/anki/util/ThreadHive.cpp

@@ -278,7 +278,7 @@ ThreadHive::Task* ThreadHive::getNewTask()
 					m_tail = prevTask;
 					m_tail = prevTask;
 				}
 				}
 
 
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 				task->m_next = nullptr;
 				task->m_next = nullptr;
 #endif
 #endif
 				break;
 				break;

+ 2 - 2
src/anki/util/ThreadPosix.cpp

@@ -91,7 +91,7 @@ void Thread::start(void* userData, ThreadCallback callback, I pinToCore)
 	}
 	}
 	else
 	else
 	{
 	{
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		m_started = true;
 		m_started = true;
 #endif
 #endif
 	}
 	}
@@ -109,7 +109,7 @@ Error Thread::join()
 		ANKI_LOGF("pthread_join() failed");
 		ANKI_LOGF("pthread_join() failed");
 	}
 	}
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	m_started = false;
 	m_started = false;
 #endif
 #endif
 
 

+ 2 - 2
src/anki/util/ThreadWindows.cpp

@@ -75,7 +75,7 @@ void Thread::start(void* userData, ThreadCallback callback, I pinToCore)
 	}
 	}
 	else
 	else
 	{
 	{
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 		m_started = true;
 		m_started = true;
 #endif
 #endif
 	}
 	}
@@ -105,7 +105,7 @@ Error Thread::join()
 
 
 	m_impl = nullptr;
 	m_impl = nullptr;
 
 
-#if ANKI_ASSERTIONS
+#if ANKI_EXTRA_CHECKS
 	m_started = false;
 	m_started = false;
 #endif
 #endif
 
 

+ 5 - 5
src/anki/util/Visitor.h

@@ -226,7 +226,7 @@ template<typename TBase, typename... Types>
 class VisitableCommonBase
 class VisitableCommonBase
 {
 {
 public:
 public:
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 	// Allow dynamic cast in acceptVisitor
 	// Allow dynamic cast in acceptVisitor
 	virtual ~VisitableCommonBase()
 	virtual ~VisitableCommonBase()
 	{
 	{
@@ -290,7 +290,7 @@ private:
 		{
 		{
 		case 0:
 		case 0:
 		{
 		{
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 			TFirst* base = dynamic_cast<TFirst*>(this);
 			TFirst* base = dynamic_cast<TFirst*>(this);
 			ANKI_ASSERT(base != nullptr);
 			ANKI_ASSERT(base != nullptr);
 #else
 #else
@@ -317,7 +317,7 @@ private:
 		{
 		{
 		case i:
 		case i:
 		{
 		{
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 			TSecond* base = dynamic_cast<TSecond*>(this);
 			TSecond* base = dynamic_cast<TSecond*>(this);
 			ANKI_ASSERT(base != nullptr);
 			ANKI_ASSERT(base != nullptr);
 #else
 #else
@@ -343,7 +343,7 @@ private:
 		{
 		{
 		case 0:
 		case 0:
 		{
 		{
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 			const TFirst* base = dynamic_cast<const TFirst*>(this);
 			const TFirst* base = dynamic_cast<const TFirst*>(this);
 			ANKI_ASSERT(base != nullptr);
 			ANKI_ASSERT(base != nullptr);
 #else
 #else
@@ -370,7 +370,7 @@ private:
 		{
 		{
 		case i:
 		case i:
 		{
 		{
-#if ANKI_DEBUG
+#if ANKI_EXTRA_CHECKS
 			const TSecond* base = dynamic_cast<const TSecond*>(this);
 			const TSecond* base = dynamic_cast<const TSecond*>(this);
 			ANKI_ASSERT(base != nullptr);
 			ANKI_ASSERT(base != nullptr);
 #else
 #else

+ 1 - 1
thirdparty

@@ -1 +1 @@
-Subproject commit 7d46a7d7ec130ddc1f77d0a8eb1d6b27eb35415b
+Subproject commit d7016db5e3d39b110f94c47340b8f6b51958d3f1