summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt14
-rw-r--r--src/porting.cpp20
2 files changed, 27 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 05446c084..c0832d0c2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -696,7 +696,7 @@ if(MSVC)
# Visual Studio
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D WIN32_LEAN_AND_MEAN /MP")
# EHa enables SEH exceptions (used for catching segfaults)
- set(CMAKE_CXX_FLAGS_RELEASE "/EHa /Ox /GL /FD /MT /GS- /Zi /fp:fast /D NDEBUG /D _HAS_ITERATOR_DEBUGGING=0 /TP")
+ set(CMAKE_CXX_FLAGS_RELEASE "/EHa /Ox /GL /FD /MD /GS- /Zi /fp:fast /D NDEBUG /D _HAS_ITERATOR_DEBUGGING=0 /TP")
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:SSE")
endif()
@@ -714,8 +714,8 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1")
# Flags for C files (sqlite)
- # /MT = Link statically with standard library stuff
- set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MT")
+ # /MD = dynamically link to MSVCRxxx.dll
+ set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MD")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# Probably GCC
@@ -828,6 +828,14 @@ if(BUILD_CLIENT)
endforeach()
endif()
+ if(USE_FREETYPE)
+ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../fonts" DESTINATION "${SHAREDIR}"
+ FILES_MATCHING PATTERN "*.ttf" PATTERN "*.txt")
+ else()
+ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../fonts" DESTINATION "${SHAREDIR}"
+ FILES_MATCHING PATTERN "*.png" PATTERN "*.xml")
+ endif()
+
if(WIN32)
if(DEFINED IRRLICHT_DLL)
install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR})
diff --git a/src/porting.cpp b/src/porting.cpp
index 302e6989a..a19c39456 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -380,14 +380,21 @@ bool setSystemPaths()
"Failed to get current executable path");
pathRemoveFile(buf, '\\');
+ std::string exepath(buf);
+
// Use ".\bin\.."
- path_share = std::string(buf) + "\\..";
+ path_share = exepath + "\\..";
+ if (detectMSVCBuildDir(exepath)) {
+ // The msvc build dir schould normaly not be present if properly installed,
+ // but its usefull for debugging.
+ path_share += DIR_DELIM "..";
+ }
- // Use "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>"
+ // Use "C:\Users\<user>\AppData\Roaming\<PROJECT_NAME_C>"
DWORD len = GetEnvironmentVariable("APPDATA", buf, sizeof(buf));
FATAL_ERROR_IF(len == 0 || len > sizeof(buf), "Failed to get APPDATA");
- path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME;
+ path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME_C;
return true;
}
@@ -561,6 +568,10 @@ void initializePaths()
if (!setSystemPaths())
errorstream << "Failed to get one or more system-wide path" << std::endl;
+
+# ifdef _WIN32
+ path_cache = path_user + DIR_DELIM + "cache";
+# else
// Initialize path_cache
// First try $XDG_CACHE_HOME/PROJECT_NAME
const char *cache_dir = getenv("XDG_CACHE_HOME");
@@ -577,7 +588,8 @@ void initializePaths()
}
// Migrate cache folder to new location if possible
migrateCachePath();
-#endif
+# endif // _WIN32
+#endif // RUN_IN_PLACE
infostream << "Detected share path: " << path_share << std::endl;
infostream << "Detected user path: " << path_user << std::endl;