mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
Enable AVX2 support
This commit is contained in:
@@ -81,6 +81,7 @@ option(WITH_BETTER_RENDERER "Experimental multi-backend renderer based on NVRHI"
|
|||||||
option(GENERATE_PDB "Generate executable with program debugging symbols" ON)
|
option(GENERATE_PDB "Generate executable with program debugging symbols" ON)
|
||||||
option(ENABLE_MCC "Enable multicore compilation" ON)
|
option(ENABLE_MCC "Enable multicore compilation" ON)
|
||||||
option(WITHDUMPGEN "Enable generating DMP files on crash" ON)
|
option(WITHDUMPGEN "Enable generating DMP files on crash" ON)
|
||||||
|
option(ENABLE_AVX2 "Enable AVX2 instruction set (requires AVX2-capable CPU, Haswell/2013 or newer)" ON)
|
||||||
|
|
||||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
@@ -508,7 +509,6 @@ else()
|
|||||||
target_compile_definitions(${PROJECT_NAME} PUBLIC WITH_DISCORD_RPC=0)
|
target_compile_definitions(${PROJECT_NAME} PUBLIC WITH_DISCORD_RPC=0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
if (TARGET OpenAL::OpenAL)
|
if (TARGET OpenAL::OpenAL)
|
||||||
target_link_libraries(${PROJECT_NAME} OpenAL::OpenAL)
|
target_link_libraries(${PROJECT_NAME} OpenAL::OpenAL)
|
||||||
@@ -583,3 +583,12 @@ if(ENABLE_MCC AND MSVC)
|
|||||||
message(STATUS "Enabling multi-processor compilation for MSVC.")
|
message(STATUS "Enabling multi-processor compilation for MSVC.")
|
||||||
add_compile_options(/MP)
|
add_compile_options(/MP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_AVX2)
|
||||||
|
message(STATUS "Enabling AVX2 instruction set.")
|
||||||
|
if (MSVC)
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE /arch:AVX2)
|
||||||
|
else()
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE -mavx2)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
2
stdafx.h
2
stdafx.h
@@ -93,6 +93,8 @@
|
|||||||
#define GLM_FORCE_SWIZZLE
|
#define GLM_FORCE_SWIZZLE
|
||||||
#define GLM_ENABLE_EXPERIMENTAL
|
#define GLM_ENABLE_EXPERIMENTAL
|
||||||
#define GLM_FORCE_CTOR_INIT
|
#define GLM_FORCE_CTOR_INIT
|
||||||
|
#define GLM_FORCE_INLINE
|
||||||
|
#define GLM_FORCE_INTRINSICS
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <glm/gtc/matrix_transform.hpp>
|
||||||
#include <glm/gtx/matrix_transform_2d.hpp>
|
#include <glm/gtx/matrix_transform_2d.hpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user