From 45976da975a21359cfcc9a05c575ed8b07575612 Mon Sep 17 00:00:00 2001
From: Yuri Kunde Schlesner
Date: Sat, 23 Aug 2014 22:22:05 -0300
Subject: CMake cleanup
Several cleanups to the buildsystem:
- Do better factoring of common libs between platforms.
- Add support to building on Windows.
- Remove Qt4 support.
- Re-sort file lists and add missing headers.
---
src/common/CMakeLists.txt | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
(limited to 'src/common')
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index aae183393..f8a55c2a7 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -1,6 +1,8 @@
+# Generate cpp with Git revision from template
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY)
-set(SRCS break_points.cpp
+set(SRCS
+ break_points.cpp
console_listener.cpp
extended_trace.cpp
file_search.cpp
@@ -12,23 +14,25 @@ set(SRCS break_points.cpp
memory_util.cpp
misc.cpp
msg_handler.cpp
- string_util.cpp
scm_rev.cpp
+ string_util.cpp
symbols.cpp
thread.cpp
timer.cpp
- utf8.cpp)
+ utf8.cpp
+ )
-set(HEADERS atomic.h
+set(HEADERS
+ atomic.h
atomic_gcc.h
atomic_win32.h
bit_field.h
break_points.h
chunk_file.h
+ common.h
common_funcs.h
common_paths.h
common_types.h
- common.h
console_listener.h
cpu_detect.h
debug_interface.h
@@ -37,10 +41,11 @@ set(HEADERS atomic.h
fifo_queue.h
file_search.h
file_util.h
+ fixed_size_queue.h
hash.h
linear_disk_cache.h
- log_manager.h
log.h
+ log_manager.h
math_util.h
mem_arena.h
memory_util.h
@@ -54,8 +59,12 @@ set(HEADERS atomic.h
swap.h
symbols.h
thread.h
+ thread_queue_list.h
thunk.h
timer.h
- utf8.h)
+ utf8.h
+ )
+
+create_directory_groups(${SRCS} ${HEADERS})
add_library(common STATIC ${SRCS} ${HEADERS})
--
cgit v1.2.3
From b15d631d996afe6e5e577643b54eeca5c8a13f19 Mon Sep 17 00:00:00 2001
From: Yuri Kunde Schlesner
Date: Fri, 22 Aug 2014 22:09:14 -0300
Subject: Avoid LOGGING redefinition warnings.
---
src/common/log.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'src/common')
diff --git a/src/common/log.h b/src/common/log.h
index f1f6ffae6..291534c67 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -4,7 +4,9 @@
#pragma once
+#ifndef LOGGING
#define LOGGING
+#endif
enum {
OS_LEVEL, // Printed by the emulated operating system
--
cgit v1.2.3
From c57de3e4046c662c5179d3b55340361a046a57ff Mon Sep 17 00:00:00 2001
From: Yuri Kunde Schlesner
Date: Mon, 1 Sep 2014 18:04:07 -0300
Subject: Remove hand-crafted Visual Studio solution.
---
src/common/common.vcxproj | 224 --------------------------------------
src/common/common.vcxproj.filters | 68 ------------
src/common/scm_rev_gen.js | 74 -------------
src/common/scm_rev_gen.vcxproj | 87 ---------------
4 files changed, 453 deletions(-)
delete mode 100644 src/common/common.vcxproj
delete mode 100644 src/common/common.vcxproj.filters
delete mode 100644 src/common/scm_rev_gen.js
delete mode 100644 src/common/scm_rev_gen.vcxproj
(limited to 'src/common')
diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj
deleted file mode 100644
index 341d3a813..000000000
--- a/src/common/common.vcxproj
+++ /dev/null
@@ -1,224 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {DFE335FC-755D-4BAA-8452-94434F8A1EDB}
- common
-
-
-
- true
- StaticLibrary
- MultiByte
- v120
-
-
- true
- StaticLibrary
- MultiByte
- v120
-
-
- false
- StaticLibrary
- Unicode
- v120
-
-
- StaticLibrary
- false
- MultiByte
-
-
- false
- StaticLibrary
- Unicode
- v120
-
-
- StaticLibrary
- false
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
- ProgramDatabase
-
-
-
-
-
- true
-
-
-
-
-
-
- true
- true
- true
-
-
-
-
-
-
- true
- true
- true
-
-
-
-
-
-
- true
- true
- true
-
-
-
-
-
-
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters
deleted file mode 100644
index 59268ce5a..000000000
--- a/src/common/common.vcxproj.filters
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/common/scm_rev_gen.js b/src/common/scm_rev_gen.js
deleted file mode 100644
index 98313e376..000000000
--- a/src/common/scm_rev_gen.js
+++ /dev/null
@@ -1,74 +0,0 @@
-var wshShell = new ActiveXObject("WScript.Shell")
-var oFS = new ActiveXObject("Scripting.FileSystemObject");
-
-var outfile = "scm_rev.cpp";
-var cmd_revision = " rev-parse HEAD";
-var cmd_describe = " describe --always --long --dirty";
-var cmd_branch = " rev-parse --abbrev-ref HEAD";
-
-var git_search_paths = {
- "git.cmd": 1,
- "git": 1,
- "C:\\Program Files (x86)\\Git\\bin\\git.exe": 1,
- "C:\\Program Files\\Git\\bin\\git.exe": 1
-};
-
-function GetGitExe() {
- for (var gitexe in git_search_paths) {
- try {
- wshShell.Exec(gitexe);
- return gitexe;
- } catch (e) {
- }
- }
-
- WScript.Echo("Cannot find git or git.cmd, check your PATH:\n" +
- wshShell.ExpandEnvironmentStrings("%PATH%"));
- WScript.Quit(1);
-}
-
-function GetFirstStdOutLine(cmd) {
- try {
- return wshShell.Exec(cmd).StdOut.ReadLine();
- } catch (e) {
- // catch "the system cannot find the file specified" error
- WScript.Echo("Failed to exec " + cmd + " this should never happen");
- WScript.Quit(1);
- }
-}
-
-function GetFileContents(f) {
- try {
- return oFS.OpenTextFile(f).ReadAll();
- } catch (e) {
- // file doesn't exist
- return "";
- }
-}
-
-// get info from git
-var gitexe = GetGitExe();
-var revision = GetFirstStdOutLine(gitexe + cmd_revision);
-var describe = GetFirstStdOutLine(gitexe + cmd_describe);
-var branch = GetFirstStdOutLine(gitexe + cmd_branch);
-var isMaster = +("master" == branch);
-
-// remove hash (and trailing "-0" if needed) from description
-describe = describe.replace(/(-0)?-[^-]+(-dirty)?$/, '$2');
-
-var out_contents =
- "#include \"common/scm_rev.h\"\n" +
- "namespace Common {\n" +
- " const char g_scm_rev[] = \"" + revision + "\";\n" +
- " const char g_scm_branch[] = \"" + branch + "\";\n" +
- " const char g_scm_desc[] = \"" + describe + "\";\n" +
- "}\n";
-
-// check if file needs updating
-if (out_contents == GetFileContents(outfile)) {
- WScript.Echo(outfile + " current at " + describe);
-} else {
- // needs updating - writeout current info
- oFS.CreateTextFile(outfile, true).Write(out_contents);
- WScript.Echo(outfile + " updated to " + describe);
-}
diff --git a/src/common/scm_rev_gen.vcxproj b/src/common/scm_rev_gen.vcxproj
deleted file mode 100644
index f4f2a6239..000000000
--- a/src/common/scm_rev_gen.vcxproj
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
-
-
-
-
-
-
- {69F00340-5C3D-449F-9A80-958435C6CF06}
- scm_rev_gen
- scm_rev_gen
-
-
-
- Utility
- false
- Unicode
- v120
-
-
- v120
-
-
- v120
-
-
- v120
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cscript /nologo /E:JScript "scm_rev_gen.js"
-
-
-
-
- cscript /nologo /E:JScript "scm_rev_gen.js"
-
-
-
-
- cscript /nologo /E:JScript "scm_rev_gen.js"
-
-
-
-
-
-
\ No newline at end of file
--
cgit v1.2.3