2023-12-31 16:17:28 +00:00
|
|
|
set(ARCH "x86_64" CACHE STRING "Target architecture (x86_32, x86_64, arm64, rv64, CUSTOM)")
|
|
|
|
|
|
|
|
string(REGEX MATCH "32$|64$" DEFAULT_BITS "${ARCH}")
|
|
|
|
set(BITS "${DEFAULT_BITS}" CACHE STRING "Architecture bits. Needs to be set manually for custom architecture")
|
|
|
|
|
|
|
|
|
|
|
|
list(APPEND GODOT_DEFINITIONS
|
|
|
|
LINUX_ENABLED
|
|
|
|
UNIX_ENABLED
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND GODOT_CC_FLAGS
|
2024-01-09 21:35:20 +00:00
|
|
|
# -fPIC is controlled by POSITION_INDEPENDENT_CODE property
|
2023-12-31 16:17:28 +00:00
|
|
|
|
|
|
|
$<$<STREQUAL:${ARCH},x86_64>:
|
|
|
|
-m64
|
|
|
|
-march=x86-64
|
|
|
|
>
|
|
|
|
$<$<STREQUAL:${ARCH},x86_32>:
|
|
|
|
-m32
|
|
|
|
-march=i686
|
|
|
|
>
|
|
|
|
$<$<STREQUAL:${ARCH},arm64>:
|
|
|
|
-march=armv8-a
|
|
|
|
>
|
|
|
|
$<$<STREQUAL:${ARCH},rv64>:
|
|
|
|
-march=rv64gc
|
|
|
|
>
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND GODOT_CXX_FLAGS
|
|
|
|
$<$<AND:$<BOOL:${USE_HOT_RELOAD}>,${compiler_is_gnu}>:
|
|
|
|
-fno-gnu-unique
|
|
|
|
>
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND GODOT_LINK_FLAGS
|
|
|
|
-Wl,-R,'$$ORIGIN'
|
|
|
|
|
|
|
|
$<$<STREQUAL:${ARCH},x86_64>:
|
|
|
|
-m64
|
|
|
|
-march=x86-64
|
|
|
|
>
|
|
|
|
$<$<STREQUAL:${ARCH},x86_32>:
|
|
|
|
-m32
|
|
|
|
-march=i686
|
|
|
|
>
|
|
|
|
$<$<STREQUAL:${ARCH},arm64>:
|
|
|
|
-march=armv8-a
|
|
|
|
>
|
|
|
|
$<$<STREQUAL:${ARCH},rv64>:
|
|
|
|
-march=rv64gc
|
|
|
|
>
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND GODOT_COMPILE_WARNING_FLAGS
|
|
|
|
-Wwrite-strings
|
|
|
|
)
|
|
|
|
|