summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-01-24 07:33:32 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-01-24 07:33:32 +0000
commitc19a986065348039ea3eb44ad180c773f13f4a70 (patch)
treeb641fad2d2218ea3379ea4826cff84ac619ec528
parentUpdated core (improved shared libraries build configuration) and samples (diff)
downloadDiligentEngine-c19a986065348039ea3eb44ad180c773f13f4a70.tar.gz
DiligentEngine-c19a986065348039ea3eb44ad180c773f13f4a70.zip
Few minor updates + updated readme
m---------DiligentTools0
-rw-r--r--README.md25
-rw-r--r--Tests/TestApp/src/TestApp.cpp4
-rw-r--r--unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt5
4 files changed, 19 insertions, 15 deletions
diff --git a/DiligentTools b/DiligentTools
-Subproject ac87e419c9000b3676425c851ed30d1d25401e0
+Subproject ee14d5e46cb02735220b2e1d6f78085a26cb5d0
diff --git a/README.md b/README.md
index 6607313..38eaf2e 100644
--- a/README.md
+++ b/README.md
@@ -328,26 +328,32 @@ Please also take a look at getting started tutorials for
If your project doesn't use CMake, it is recommended to build libraries with CMake and add them to your build system.
For Windows platforms, you can download the latest build artifacts from [appveyor](https://ci.appveyor.com/project/DiligentGraphics/diligentcore).
+
+Global CMake installation directory is controlled by `CMAKE_INTALL_PREFIX` variable. Within that directory,
+`DILIGENT_CORE_INSTALL_DIR` defines the subdirectory where libraries and headers are installed.
+Note that [CMAKE_INTALL_PREFIX](https://cmake.org/cmake/help/v3.13/variable/CMAKE_INSTALL_PREFIX.html) defaults
+to `/usr/local` on UNIX and `c:/Program Files/${PROJECT_NAME}` on Windows, which may not be what you want.
+Use `-D CMAKE_INSTALL_PREFIX=install` to use local `install` folder instead:
+
+```
+cmake -H. -B./cmk_build/Win64 -D CMAKE_INSTALL_PREFIX=install -G "Visual Studio 15 2017 Win64"
+```
+
To install libraries and header files, run the following CMake command from the build folder:
```cmake
cmake --build . --target install
```
-Global cmake installation directory is controlled by `CMAKE_INTALL_PREFIX` variable. Within that directory,
-`DILIGENT_CORE_INSTALL_DIR` defines the subdirectory where libraries and headers will be installed.
-Note that by default CMake will be attempting to install to a system directory (such as *Program Files* on Windows),
-which is likely not what you want. Use `-D CMAKE_INSTALL_PREFIX=install` to use local *install* folder instead.
-
DiligentCore installation directory will contain everything required to integrate the engine:
* *headers* subdirectory will contain all required header files. Add this directory to your include search directories.
* *lib* subdirectory will contain static libraries.
* *bin* subdirectory will contain dynamic libraries.
-When linking statically, you will need to list DiligentCore as well as all third-party libraries used
-by the engine. Besides that, you will also need to specify platform-specific system libraries.
-For Windows platform, the list of libraries your project will need to link against may look like this:
+An easier way is to link with dynamic libraries. When linking statically, you will need to list DiligentCore as well
+as all third-party libraries used by the engine. Besides that, you will also need to specify platform-specific system libraries.
+For example, for Windows platform, the list of libraries your project will need to link against may look like this:
```
DiligentCore.lib glslang.lib HLSL.lib OGLCompiler.lib OSDependent.lib SPIRVCross.lib SPIRV.lib SPIRV-Tools-opt.lib SPIRV-Tools.lib glew-static.lib vulkan-1.lib dxgi.lib d3d11.lib d3d12.lib d3dcompiler.lib opengl32.lib
@@ -355,6 +361,9 @@ DiligentCore.lib glslang.lib HLSL.lib OGLCompiler.lib OSDependent.lib SPIRVCross
Vulkan libraries can be found in [DiligentCore/External/vulkan/libs](https://github.com/DiligentGraphics/DiligentCore/tree/master/External/vulkan/libs) directory.
+Diligent Engine headers require one of the following platform macros to be defined as `1`:
+`PLATFORM_WIN32`, `PLATFORM_UNIVERSAL_WINDOWS`, `PLATFORM_ANDROID`, `PLATFORM_LINUX`, `PLATFORM_MACOS`, `PLATFORM_IOS`.
+
Another way to intergrate the engine is to generate build files (such as Visual Studio projects) and add them to your
build system. Build customization described below can help tweak the settings for your specific needs.
diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp
index 45b9159..dbf4f90 100644
--- a/Tests/TestApp/src/TestApp.cpp
+++ b/Tests/TestApp/src/TestApp.cpp
@@ -242,7 +242,7 @@ void TestApp::InitializeDiligentEngine(
#if !PLATFORM_MACOS
VERIFY_EXPR(NativeWindowHandle != nullptr);
#endif
-#if ENGINE_DLL && (PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS)
+#if EXPLICITLY_LOAD_ENGINE_GL_DLL
// Declare function pointer
GetEngineFactoryOpenGLType GetEngineFactoryOpenGL = nullptr;
// Load the dll and import GetEngineFactoryOpenGL() function
@@ -269,7 +269,7 @@ void TestApp::InitializeDiligentEngine(
#if VULKAN_SUPPORTED
case DeviceType::Vulkan:
{
-#if ENGINE_DLL && PLATFORM_WIN32
+#if EXPLICITLY_LOAD_ENGINE_VK_DLL
GetEngineFactoryVkType GetEngineFactoryVk = nullptr;
// Load the dll and import GetEngineFactoryVk() function
LoadGraphicsEngineVk(GetEngineFactoryVk);
diff --git a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
index acac459..a340286 100644
--- a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
+++ b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
@@ -116,11 +116,6 @@ if(MSVC)
target_compile_options(GhostCubePlugin-shared PRIVATE /wd4201)
endif()
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
- CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- set_target_properties(GhostCubePlugin-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden
-endif()
-
set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins)
if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)