1diff --git a/CMakeLists.txt b/CMakeLists.txt
2index 0242fb71..5007aace 100644
3--- a/CMakeLists.txt
4+++ b/CMakeLists.txt
5@@ -304,7 +304,6 @@ else()
6 # To be safe, only include them when building 'release' outputs.
7 add_compile_options(
8 -g
9- -fno-limit-debug-info
10 -fPIE
11 -fpie
12 -fPIC
13@@ -449,12 +448,6 @@ elseif(CLANG AND DEPS AND NOT FREEBSD)
14 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto=thin")
15 endif()
16
17-if(NOT IS_DIRECTORY "${CMAKE_SOURCE_DIR}/third-party/sqlite3")
18- WARNING_LOG("Cannot find git submodule third-party/sqlite3 directory")
19- WARNING_LOG("Please run: make deps or git submodule update --init")
20- message(FATAL_ERROR "No sqlite3 directory")
21-endif()
22-
23 # Make sure deps were built before compiling (else show warning).
24 execute_process(
25 COMMAND "${CMAKE_SOURCE_DIR}/tools/provision.sh" check "${CMAKE_BINARY_DIR}"
26@@ -521,6 +514,8 @@ endif()
27
28 if(APPLE)
29 LOG_PLATFORM("OS X")
30+elseif(OSQUERY_BUILD_PLATFORM STREQUAL "nixos")
31+ LOG_PLATFORM("NixOS")
32 elseif(OSQUERY_BUILD_PLATFORM STREQUAL "debian")
33 LOG_PLATFORM("Debian")
34 elseif(OSQUERY_BUILD_PLATFORM STREQUAL "ubuntu")
35@@ -570,7 +565,6 @@ if(POSIX AND DEPS)
36 endif()
37 endif()
38
39-include_directories("${CMAKE_SOURCE_DIR}/third-party/sqlite3")
40 include_directories("${CMAKE_SOURCE_DIR}/include")
41 include_directories("${CMAKE_SOURCE_DIR}")
42
43@@ -661,18 +655,6 @@ if(FREEBSD OR "${HAVE_TR1_TUPLE}" STREQUAL "")
44 add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=0)
45 endif()
46
47-set(GTEST_FLAGS
48- "-I${CMAKE_SOURCE_DIR}/third-party/googletest/googletest/include"
49- "-I${CMAKE_SOURCE_DIR}/third-party/googletest/googlemock/include"
50-)
51-join("${GTEST_FLAGS}" " " GTEST_FLAGS)
52-
53-if(NOT SKIP_TESTS)
54- add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/googletest")
55-endif()
56-
57-add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/sqlite3")
58-
59 if(NOT FREEBSD)
60 add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/linenoise-ng")
61 endif()
62diff --git a/osquery/CMakeLists.txt b/osquery/CMakeLists.txt
63index e3842962..f405503d 100644
64--- a/osquery/CMakeLists.txt
65+++ b/osquery/CMakeLists.txt
66@@ -33,8 +33,6 @@ if(CLANG AND POSIX)
67 -Wextra
68 -pedantic
69 -Wuseless-cast
70- -Wno-c99-extensions
71- -Wno-zero-length-array
72 -Wno-unused-parameter
73 -Wno-gnu-case-range
74 -Weffc++
75@@ -63,14 +61,7 @@ endif()
76
77 # Construct a set of all object files, starting with third-party and all
78 # of the osquery core objects (sources from ADD_CORE_LIBRARY macros).
79-if(FREEBSD)
80- set(OSQUERY_OBJECTS $<TARGET_OBJECTS:osquery_sqlite>)
81-else()
82- set(OSQUERY_OBJECTS
83- $<TARGET_OBJECTS:osquery_sqlite>
84- $<TARGET_OBJECTS:linenoise-ng>
85- )
86-endif()
87+set(OSQUERY_OBJECTS $<TARGET_OBJECTS:linenoise-ng>)
88
89 # Add subdirectories
90 add_subdirectory(config)
91@@ -151,10 +142,11 @@ if(APPLE OR LINUX)
92 ADD_OSQUERY_LINK_ADDITIONAL("rocksdb_lite")
93 elseif(FREEBSD)
94 ADD_OSQUERY_LINK_CORE("icuuc")
95- ADD_OSQUERY_LINK_CORE("linenoise")
96 ADD_OSQUERY_LINK_ADDITIONAL("rocksdb-lite")
97 endif()
98
99+ADD_OSQUERY_LINK_CORE("sqlite3")
100+
101 if(POSIX)
102 ADD_OSQUERY_LINK_CORE("boost_system")
103 ADD_OSQUERY_LINK_CORE("boost_filesystem")
104@@ -172,10 +164,10 @@ endif()
105 ADD_OSQUERY_LINK_CORE("glog${WO_KEY}")
106
107 if(POSIX)
108- # Hashing methods in core use libcrypto.
109- ADD_OSQUERY_LINK_CORE("crypto")
110-
111+ ADD_OSQUERY_LINK_ADDITIONAL("benchmark")
112+ ADD_OSQUERY_LINK_ADDITIONAL("snappy")
113 ADD_OSQUERY_LINK_ADDITIONAL("ssl")
114+ ADD_OSQUERY_LINK_ADDITIONAL("crypto")
115 ADD_OSQUERY_LINK_ADDITIONAL("libpthread")
116 ADD_OSQUERY_LINK_ADDITIONAL("magic")
117 endif()
118diff --git a/osquery/extensions/CMakeLists.txt b/osquery/extensions/CMakeLists.txt
119index 52f3bf80..066ed1c0 100644
120--- a/osquery/extensions/CMakeLists.txt
121+++ b/osquery/extensions/CMakeLists.txt
122@@ -60,12 +60,6 @@ else()
123 )
124 endif()
125
126-if(NOT WINDOWS)
127- add_compile_options(
128- -Wno-macro-redefined
129- )
130-endif()
131-
132 ADD_OSQUERY_LIBRARY(TRUE osquery_extensions
133 ${THRIFT_GENERATED_FILES}
134 ${THRIFT_IMPL_FILE}
135diff --git a/osquery/logger/CMakeLists.txt b/osquery/logger/CMakeLists.txt
136index ab91bd24..d8364991 100644
137--- a/osquery/logger/CMakeLists.txt
138+++ b/osquery/logger/CMakeLists.txt
139@@ -55,9 +55,9 @@ if(NOT SKIP_KAFKA AND NOT WINDOWS AND NOT FREEBSD)
140
141 ADD_OSQUERY_LINK_ADDITIONAL("rdkafka")
142
143- set(OSQUERY_LOGGER_KAFKA_PLUGINS_TESTS
144- "logger/plugins/tests/kafka_producer_tests.cpp"
145- )
146+ #set(OSQUERY_LOGGER_KAFKA_PLUGINS_TESTS
147+ # "logger/plugins/tests/kafka_producer_tests.cpp"
148+ #)
149
150 ADD_OSQUERY_TEST_ADDITIONAL(${OSQUERY_LOGGER_KAFKA_PLUGINS_TESTS})
151 endif()
152diff --git a/osquery/tables/CMakeLists.txt b/osquery/tables/CMakeLists.txt
153index 3ecbb711..af7220d3 100644
154--- a/osquery/tables/CMakeLists.txt
155+++ b/osquery/tables/CMakeLists.txt
156@@ -68,7 +68,7 @@ if(LINUX)
157 set(TABLE_PLATFORM "linux")
158
159 ADD_OSQUERY_LINK_ADDITIONAL("libresolv.so")
160- ADD_OSQUERY_LINK_ADDITIONAL("cryptsetup devmapper lvm2app lvm-internal daemonclient")
161+ ADD_OSQUERY_LINK_ADDITIONAL("cryptsetup devmapper lvm2app")
162 ADD_OSQUERY_LINK_ADDITIONAL("gcrypt gpg-error")
163 ADD_OSQUERY_LINK_ADDITIONAL("blkid")
164 ADD_OSQUERY_LINK_ADDITIONAL("ip4tc")
165diff --git a/specs/windows/services.table b/specs/windows/services.table
166index 4ac24ee9..657d8b99 100644
167--- a/specs/windows/services.table
168+++ b/specs/windows/services.table
169@@ -12,7 +12,7 @@ schema([
170 Column("path", TEXT, "Path to Service Executable"),
171 Column("module_path", TEXT, "Path to ServiceDll"),
172 Column("description", TEXT, "Service Description"),
173- Column("user_account", TEXT, "The name of the account that the service process will be logged on as when it runs. This name can be of the form Domain\UserName. If the account belongs to the built-in domain, the name can be of the form .\UserName."),
174+ Column("user_account", TEXT, "The name of the account that the service process will be logged on as when it runs. This name can be of the form Domain\\UserName. If the account belongs to the built-in domain, the name can be of the form .\\UserName."),
175 ])
176 implementation("system/windows/services@genServices")
177 examples([