Browse Source

Add new build options to control FileWatcher/profiling/logging support.

Yao Wei Tjong 姚伟忠 11 năm trước cách đây
mục cha
commit
62ce85adfe
3 tập tin đã thay đổi với 18 bổ sung6 xóa
  1. 3 0
      Docs/GettingStarted.dox
  2. 3 0
      Readme.txt
  3. 12 6
      Source/CMake/Modules/Urho3D-CMake-common.cmake

+ 3 - 0
Docs/GettingStarted.dox

@@ -150,6 +150,9 @@ A number of build options can be defined explicitly when invoking the above cmak
 |-DENABLE_ANGELSCRIPT=0|to disable AngelScript scripting support|
 |-DENABLE_SSE=0        |to disable SSE instruction set|
 |-DENABLE_MINIDUMPS=0  |to disable minidumps on crash (VS only)|
+|-DENABLE_FILEWATCHER=0|to disable filewatcher support|
+|-DENABLE_PROFILING=0  |to disable profiling support|
+|-DENABLE_LOGGING=0    |to disable logging support|
 |-DUSE_OPENGL=1        |to use OpenGL instead of Direct3D (only useful for VS on Windows platform because this option is enabled by default for other platforms)|
 |-DUSE_MKLINK=1        |to use mklink command to create symbolic links (Windows Vista and above only)|
 |-DUSE_STATIC_RUNTIME=1|to use static C/C++ runtime libraries and eliminate the need for runtime DLLs installation (VS only)|

+ 3 - 0
Readme.txt

@@ -440,6 +440,9 @@ cmake_xxxx batch files or shell scripts.
 |-DENABLE_ANGELSCRIPT=0|to disable AngelScript scripting support               |
 |-DENABLE_SSE=0        |to disable SSE instruction set                         |
 |-DENABLE_MINIDUMPS=0  |to disable minidumps on crash (VS only)                |
+|-DENABLE_FILEWATCHER=0|to disable filewatcher support                         |
+|-DENABLE_PROFILING=0  |to disable profiling support                           |
+|-DENABLE_LOGGING=0    |to disable logging support                             |
 |-DUSE_OPENGL=1        |to use OpenGL instead of Direct3D (only useful for VS  |
 |                      | on Windows platform because this option is enabled by |
 |                      | default for other platforms)                          | 

+ 12 - 6
Source/CMake/Modules/Urho3D-CMake-common.cmake

@@ -71,14 +71,20 @@ if (MSVC)
     endif ()
 endif ()
 
-# Enable file watcher support for automatic resource reloads.
-add_definitions (-DENABLE_FILEWATCHER)
+# Enable file watcher support for automatic resource reloads by default.
+if (ENABLE_FILEWATCHER OR NOT DEFINED ENABLE_FILEWATCHER)
+    add_definitions (-DENABLE_FILEWATCHER)
+endif ()
 
-# Enable profiling. If disabled, autoprofileblocks become no-ops and the Profiler subsystem is not instantiated.
-add_definitions (-DENABLE_PROFILING)
+# Enable profiling by default. If disabled, autoprofileblocks become no-ops and the Profiler subsystem is not instantiated.
+if (ENABLE_PROFILING OR NOT DEFINED ENABLE_PROFILING)
+    add_definitions (-DENABLE_PROFILING)
+endif ()
 
-# Enable logging. If disabled, LOGXXXX macros become no-ops and the Log subsystem is not instantiated.
-add_definitions (-DENABLE_LOGGING)
+# Enable logging by default. If disabled, LOGXXXX macros become no-ops and the Log subsystem is not instantiated.
+if (ENABLE_LOGGING OR NOT DEFINED ENABLE_LOGGING)
+    add_definitions (-DENABLE_LOGGING)
+endif ()
 
 # If not on MSVC, enable use of OpenGL instead of Direct3D9 (either not compiling on Windows or
 # with a compiler that may not have an up-to-date DirectX SDK). This can also be unconditionally