]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add CMakeLists.txt
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 19 Mar 2016 13:01:05 +0000 (00:01 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 14 Apr 2016 11:02:18 +0000 (21:02 +1000)
CMakeLists.txt [new file with mode: 0644]
cmake/CMakeASMCompiler.cmake.in [new file with mode: 0644]
cmake/CMakeASMInformation.cmake [new file with mode: 0644]
cmake/CMakeDetermineASMCompiler.cmake [new file with mode: 0644]
cmake/CMakeTestASMCompiler.cmake [new file with mode: 0644]
cmake/qcc.sh [new file with mode: 0755]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a200897
--- /dev/null
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 2.8.11)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+project(xonotic-data LANGUAGES ASM)
+
+add_definitions(-DWATERMARK=\"12345\")
+add_definitions(-DNDEBUG=1)
+include_directories(qcsrc)
+
+set_source_files_properties(
+        qcsrc/client/progs.inc
+        qcsrc/server/progs.inc
+        qcsrc/menu/progs.inc
+        PROPERTIES
+        LANGUAGE ASM
+        HEADER_FILE_ONLY FALSE
+)
+
+add_executable(csprogs qcsrc/client/progs.inc)
+target_compile_definitions(csprogs PRIVATE -DCSQC)
+
+add_executable(progs qcsrc/server/progs.inc)
+target_compile_definitions(progs PRIVATE -DSVQC)
+
+add_executable(menu qcsrc/menu/progs.inc)
+target_compile_definitions(menu PRIVATE -DMENUQC)
diff --git a/cmake/CMakeASMCompiler.cmake.in b/cmake/CMakeASMCompiler.cmake.in
new file mode 100644 (file)
index 0000000..e18e9ed
--- /dev/null
@@ -0,0 +1,8 @@
+set(CMAKE_ASM_COMPILER "@CMAKE_ASM_COMPILER@")
+set(CMAKE_ASM_COMPILER_LOADED 1)
+
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS qc;qh;inc)
+set(CMAKE_ASM_OUTPUT_EXTENSION .o)
+set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)
+set(CMAKE_ASM_LINKER_PREFERENCE 42)
+set(CMAKE_ASM_COMPILER_ENV_VAR "QCC")
diff --git a/cmake/CMakeASMInformation.cmake b/cmake/CMakeASMInformation.cmake
new file mode 100644 (file)
index 0000000..8fd541b
--- /dev/null
@@ -0,0 +1,8 @@
+# TODO: <DEFINES> <INCLUDES> <FLAGS>
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> compile <OBJECT> <DEFINES> -DGMQCC <FLAGS> <SOURCE>")
+set(CMAKE_ASM_LINK_EXECUTABLE "<CMAKE_ASM_COMPILER> link <OBJECTS> -o <TARGET>")
+
+set(CMAKE_INCLUDE_FLAG_ASM "-I")
+set(CMAKE_INCLUDE_FLAG_ASM_SEP "")
+set(CMAKE_EXECUTABLE_PREFIX_ASM "")
+set(CMAKE_EXECUTABLE_SUFFIX_ASM ".dat")
diff --git a/cmake/CMakeDetermineASMCompiler.cmake b/cmake/CMakeDetermineASMCompiler.cmake
new file mode 100644 (file)
index 0000000..e8e6976
--- /dev/null
@@ -0,0 +1,5 @@
+set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/cmake/qcc.sh)
+
+configure_file(cmake/CMakeASMCompiler.cmake.in
+        ${CMAKE_PLATFORM_INFO_DIR}/CMakeASMCompiler.cmake @ONLY)
+set(CMAKE_ASM_COMPILER_ENV_VAR "QCC")
diff --git a/cmake/CMakeTestASMCompiler.cmake b/cmake/CMakeTestASMCompiler.cmake
new file mode 100644 (file)
index 0000000..9d293a8
--- /dev/null
@@ -0,0 +1 @@
+set(CMAKE_ASM_COMPILER_WORKS 1 CACHE INTERNAL "")
diff --git a/cmake/qcc.sh b/cmake/qcc.sh
new file mode 100755 (executable)
index 0000000..0fbd8db
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+QCC=${QCC:-$(dirname "$0")/../../../gmqcc/gmqcc}
+case $1 in
+    compile)
+        echo $@
+        cpp ${@:3} | sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' > $2
+    ;;
+    link)
+        ${QCC} \
+        -std=gmqcc \
+        -Ooverlap-locals \
+        -O3 \
+        -Werror -Wall \
+        -Wno-field-redeclared \
+        -flno -futf8 -fno-bail-on-werror \
+        -frelaxed-switch -freturn-assignments \
+        ${@:2}
+    ;;
+esac