Add compile time endianess
This commit is contained in:
@@ -2,6 +2,20 @@
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
# Setup endianess at compile time to optimize.
|
||||
include(TestBigEndian)
|
||||
test_big_endian(IS_BIG_ENDIAN)
|
||||
if(IS_BIG_ENDIAN)
|
||||
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
DUSK_PLATFORM_ENDIAN_BIG
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
DUSK_PLATFORM_ENDIAN_LITTLE
|
||||
)
|
||||
endif()
|
||||
|
||||
# Link required libraries.
|
||||
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
SDL2
|
||||
pthread
|
||||
@@ -10,6 +24,7 @@ target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
m
|
||||
)
|
||||
|
||||
# Define platform-specific macros.
|
||||
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
DUSK_SDL2
|
||||
DUSK_OPENGL
|
||||
|
||||
@@ -23,6 +23,7 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
DUSK_OPENGL
|
||||
DUSK_PSP
|
||||
DUSK_INPUT_GAMEPAD
|
||||
DUSK_PLATFORM_ENDIAN_LITTLE
|
||||
)
|
||||
|
||||
# Postbuild, create .pbp file for PSP.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
include(./dolphin.cmake)
|
||||
|
||||
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC DUSK_WII)
|
||||
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
|
||||
DUSK_WII
|
||||
DUSK_PLATFORM_ENDIAN_BIG
|
||||
)
|
||||
Reference in New Issue
Block a user