CMake build system
This commit is contained in:
1 parent
4fed624cff
commit
4c6f3f81eb
40 files changed
+1641
No files matched your search
@@ -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()
|
||||
Reference in new issue
Block a user