diff --git a/CMakeLists.txt b/CMakeLists.txt index d504457f..9ed366ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,9 @@ if (DOBBY_DEBUG) add_definitions(-DDOBBY_DEBUG) add_definitions(-DLOGGING_DEBUG) message(STATUS "[Dobby] Enable debug logging") +else () + add_definitions(-DLOGGING_DISABLE) + message(STATUS "[Dobby] Disable logging") endif () # Enable full floating point register pack @@ -381,4 +384,4 @@ endif () if (SYSTEM.Darwin AND (NOT BUILDING_KERNEL)) include(cmake/platform/platform-darwin.cmake) -endif () \ No newline at end of file +endif () diff --git a/builtin-plugin/SymbolResolver/CMakeLists.txt b/builtin-plugin/SymbolResolver/CMakeLists.txt index eb32a8c7..61a173fa 100644 --- a/builtin-plugin/SymbolResolver/CMakeLists.txt +++ b/builtin-plugin/SymbolResolver/CMakeLists.txt @@ -36,15 +36,17 @@ if (SYSTEM.Windows) ) endif () -add_library(macho_ctx_kit - macho/macho_ctx.h - macho/macho_ctx.cc - ) - -add_library(shared_cache_ctx_kit - macho/shared_cache_ctx.h - macho/shared_cache_ctx.cpp - ) +if (SYSTEM.Darwin) + add_library(macho_ctx_kit + macho/macho_ctx.h + macho/macho_ctx.cc + ) + + add_library(shared_cache_ctx_kit + macho/shared_cache_ctx.h + macho/shared_cache_ctx.cpp + ) +endif () add_library(dobby_symbol_resolver ${SOURCE_FILE_LIST} diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index dc976191..4cefb221 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,10 +1,13 @@ +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + add_executable(socket_example main.cc socket_example.cc ) target_link_libraries(socket_example - dobby + dobby Threads::Threads ) @@ -13,5 +16,5 @@ add_library(socket_example_lib SHARED ) target_link_libraries(socket_example_lib - dobby - ) \ No newline at end of file + dobby Threads::Threads + ) diff --git a/source/dobby/common.h b/source/dobby/common.h index 94d897bd..689d52e9 100644 --- a/source/dobby/common.h +++ b/source/dobby/common.h @@ -1,5 +1,9 @@ #pragma once +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + #include "dobby.h" #include "dobby/types.h" #include "dobby/platform_features.h" @@ -8,4 +12,5 @@ #include "dobby/pac_kit.h" #include "logging/logging.h" -#include "logging/check_logging.h" \ No newline at end of file +#include "logging/check_logging.h" +