Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 22:34:24 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 22:34:24 +1000
commit58a036ffb0a61fd2fd208d0d7cef5db41cc07654 (patch)
treee244d21e34a251812113096246e7c1453882ecdb /source
parent3ee57afd3213d5501b9b074e2031d1bcd3f1094f (diff)
get Ninja + CCache working on Windows
Diffstat (limited to 'source')
-rw-r--r--source/CMakeLists.txt25
-rw-r--r--source/CMakeSettings.json46
2 files changed, 66 insertions, 5 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index cf507c6..d8f01a4 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -1,13 +1,24 @@
-PROJECT (starbound)
+CMAKE_MINIMUM_REQUIRED (VERSION 3.4)
+
+# Find CCache
+FIND_PROGRAM(CCACHE_PATH ccache)
+IF (CCACHE_PATH)
+ SET (CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
+ SET (CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
+ MESSAGE (STATUS "Using CCache")
+ELSE ()
+ MESSAGE (STATUS "Not using CCache")
+ENDIF ()
-CMAKE_MINIMUM_REQUIRED (VERSION 3.0)
+
+PROJECT (starbound)
SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
SET (CMAKE_CONFIGURATION_TYPES Debug RelWithAsserts RelWithDebInfo Release)
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHASSERTS "" CACHE STRING "" FORCE)
# Update the docstring on CMAKE_BUILD_TYPE to show what options we actually
# allow
-SET (CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: Debug RelWithAsserts RelWithDebInfo Release" FORCE)
+# SET (CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: Debug RelWithAsserts RelWithDebInfo Release" FORCE)
# Discover all the relevant environment / system information and place the
# result in STAR_* cmake variables.
@@ -135,7 +146,7 @@ IF (DEFINED STAR_ENABLE_STEAM_INTEGRATION)
ENDIF ()
IF (DEFINED STAR_ENABLE_DISCORD_INTEGRATION)
- MESSAGE (STATUS "Using Discrod platform services: ${STAR_ENABLE_DISCORD_INTEGRATION}")
+ MESSAGE (STATUS "Using Discord platform services: ${STAR_ENABLE_DISCORD_INTEGRATION}")
ENDIF ()
MESSAGE (STATUS "Using Lua API checks: ${STAR_LUA_APICHECK}")
@@ -364,7 +375,11 @@ ELSEIF (STAR_SYSTEM_WINDOWS)
SET (CMAKE_RC_COMPILER_INIT windres)
ENABLE_LANGUAGE (RC)
- SET (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
+ IF (STAR_COMPILER STREQUAL "msvc")
+ SET (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> /fo <OBJECT> <SOURCE>")
+ ELSE ()
+ SET (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
+ ENDIF()
ENDIF ()
IF (STAR_COMPILER STREQUAL "msvc")
diff --git a/source/CMakeSettings.json b/source/CMakeSettings.json
new file mode 100644
index 0000000..2ef152b
--- /dev/null
+++ b/source/CMakeSettings.json
@@ -0,0 +1,46 @@
+{
+ "configurations": [
+ {
+ "name": "x64-RelWithDebInfo",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "buildRoot": "${projectDir}\\..\\build",
+ "installRoot": "${projectDir}\\..\\out\\install\\${name}",
+ "cmakeCommandArgs": "-DCMAKE_INCLUDE_PATH=\"..\\lib\\windows64\\include\" -DCMAKE_LIBRARY_PATH=\"..\\lib\\windows64\"",
+ "variables": [
+ {
+ "name": "STAR_ENABLE_STEAM_INTEGRATION",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "STAR_ENABLE_DISCORD_INTEGRATION",
+ "value": "True",
+ "type": "BOOL"
+ }
+ ]
+ },
+ {
+ "name": "x64-Release",
+ "generator": "Ninja",
+ "configurationType": "Release",
+ "buildRoot": "${projectDir}\\..\\build",
+ "installRoot": "${projectDir}\\..\\out\\install\\${name}",
+ "cmakeCommandArgs": "-DCMAKE_INCLUDE_PATH=\"..\\lib\\windows64\\include\" -DCMAKE_LIBRARY_PATH=\"..\\lib\\windows64\"",
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "variables": [
+ {
+ "name": "STAR_ENABLE_STEAM_INTEGRATION",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "STAR_ENABLE_DISCORD_INTEGRATION",
+ "value": "True",
+ "type": "BOOL"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file