CMake build system

This commit is contained in:
Tim Angus committed 2025-08-03 17:36:01 +01:00
1 parent 4fed624cff
commit 4c6f3f81eb
40 files changed
+1641

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
include_guard(GLOBAL)
set(DETECT_ARCH_C ${CMAKE_BINARY_DIR}/detect_arch.c)
file(WRITE ${DETECT_ARCH_C}
"#include \"${SOURCE_DIR}/qcommon/q_platform.h\"
#include <stdio.h>
int main()
{
puts(ARCH_STRING);
return 0;
}
")
try_run(RUN_EXITCODE COMPILE_SUCCESS
${CMAKE_BINARY_DIR} ${DETECT_ARCH_C}
RUN_OUTPUT_VARIABLE ARCH)
string(STRIP ${ARCH} ARCH)
if(NOT COMPILE_SUCCESS OR RUN_EXITCODE OR NOT ARCH)
message(FATAL_ERROR "Architecture detection failed")
endif()