mirror of
https://github.com/rt64/rt64.git
synced 2025-01-01 03:38:09 +00:00
Build statically when buiding examples
This commit is contained in:
parent
52ff2c65d6
commit
5f80997e5c
@ -3,7 +3,10 @@ project(rt64)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
option(RT64_BUILD_EXAMPLES "Build examples for RT64" ON)
|
||||
option(RT64_BUILD_EXAMPLES "Build examples for RT64" OFF)
|
||||
if (${RT64_BUILD_EXAMPLES})
|
||||
set(RT64_STATIC ON)
|
||||
endif()
|
||||
|
||||
function(preprocess INFILE OUTFILE OPTIONS)
|
||||
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||
|
@ -6,20 +6,15 @@ namespace RT64 {
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::unique_ptr<RT64::RenderInterface> renderInterface;
|
||||
std::unique_ptr<RT64::RenderInterface> renderInterface = RT64::CreateVulkanInterface();
|
||||
|
||||
// Create a render interface with the preferred backend.
|
||||
#ifdef _WIN32
|
||||
// Windows only: Can also use D3D12.
|
||||
const bool useVulkan = true;
|
||||
if (useVulkan) {
|
||||
renderInterface = RT64::CreateVulkanInterface();
|
||||
}
|
||||
else {
|
||||
#ifdef _WIN64
|
||||
if (!useVulkan) {
|
||||
renderInterface = RT64::CreateD3D12Interface();
|
||||
#else
|
||||
assert(false);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Execute a blocking test that creates a window and draws some geometry to test the render interface.
|
||||
RT64::RenderInterfaceTest(renderInterface.get());
|
||||
|
Loading…
Reference in New Issue
Block a user