Skip to content

Commit

Permalink
Move CMake mods to root easy_profiler for easy_maintenance, build upd…
Browse files Browse the repository at this point in the history
…ates for D3D11 default
  • Loading branch information
JoshEngebretson committed Jul 5, 2017
1 parent 05974d7 commit 208fe12
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Build/Scripts/Bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function printHelp() {
console.log("--vs2015 : Build with VS2015");
console.log("--vs2017 : Build with VS2017");
console.log("--opengl : Enable OpenGL renderer");
console.log("--d3d11 : Enable DirectX 11 renderer");
console.log("--d3d9 : Enable DirectX 9 renderer");
}

console.log("--------------------------")
Expand Down Expand Up @@ -106,22 +106,22 @@ if (cmd == "buildeditor") {
}
}

if (config["d3d11"] && config["opengl"]) {
if (config["d3d9"] && config["opengl"]) {

if (os.platform() == "win32") {
console.log("\nBoth DirectX 11 and OpenGL flags specified. Please choose only one at a time.\nExiting...\n");
console.log("\nBoth DirectX 9 and OpenGL flags specified. Please choose only one at a time.\nExiting...\n");
process.exit(1);
}
}

if (config["d3d11"]) {
if (config["d3d9"]) {

if (os.platform() != "win32") {
console.log("\nDirectX 11 build requires Windows, exiting\n");
console.log("\nDirectX 9 build requires Windows, exiting\n");
process.exit(1);
}
else {
console.log("\nDirectX 11 build selected.\n");
console.log("\nDirectX 9 build selected.\n");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Build/Scripts/BuildWindows.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ namespace('build', function() {
// Redistributable editor build
flags += "-DATOMIC_DEV_BUILD=0";

// graphics backend (overrides default DX9)
// graphics backend overrides, defaults to D3D11
flags += " -DATOMIC_OPENGL=" + (config["opengl"] ? "ON" : "OFF");
flags += " -DATOMIC_D3D11=" + (config["d3d11"] ? "ON" : "OFF");
flags += " -DATOMIC_D3D11=" + (config["d3d9"] ? "OFF" : "ON");

flags += "\"";

Expand Down
4 changes: 2 additions & 2 deletions Build/Scripts/CMakeWindows.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ namespace('build', function() {
// local cmake builds are always dev builds
var flags = "-DATOMIC_DEV_BUILD=1";

// graphics backend (overrides default DX9)
// graphics backend overrides, defaults DX11
flags += " -DATOMIC_OPENGL=" + (config["opengl"] ? "ON" : "OFF");
flags += " -DATOMIC_D3D11=" + (config["d3d11"] ? "ON" : "OFF");
flags += " -DATOMIC_D3D11=" + (config["d3d9"] ? "OFF" : "ON");

return flags;

Expand Down
7 changes: 7 additions & 0 deletions Source/ThirdParty/easy_profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ find_package(Qt5Widgets)
set(EASY_OPTION_LIB_STATIC ON CACHE BOOL "" FORCE)
set(EASY_OPTION_PREDEFINED_COLORS ON CACHE BOOL "" FORCE)
set(EASY_PROFILER_NO_SAMPLES ON CACHE BOOL "" FORCE)
set(BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK OFF CACHE BOOL "" FORCE)

# force std::chrono::high_resolution_clock usage on iOS
if (IOS)
set(BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK ON FORCE)
endif()

if ("${CMAKE_SOURCE_DIR}" STREQUAL "${easy_profiler_SOURCE_DIR}")
# Do not set these paths if easy_profiler is added as dependency to other projects.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ endif (WIN32)
set(BUILD_WITH_CHRONO_STEADY_CLOCK OFF CACHE BOOL "Use std::chrono::steady_clock as a timer" )
set(BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK OFF CACHE BOOL "Use std::chrono::high_resolution_clock as a timer")

# ATOMIC BEGIN
# force std::chrono::high_resolution_clock usage on iOS
if (IOS)
set(BUILD_WITH_CHRONO_HIGH_RESOLUTION_CLOCK ON)
endif()
# ATOMIC END

message(STATUS "-------- EASY_PROFILER OPTIONS: --------")
if (BUILD_WITH_CHRONO_STEADY_CLOCK)
message(STATUS " Use std::chrono::steady_clock as a timer")
Expand Down

0 comments on commit 208fe12

Please sign in to comment.