From 786991f3ea689899be6c51ad48fd2d4ec2828289 Mon Sep 17 00:00:00 2001 From: geneotech Date: Sun, 29 Oct 2023 15:45:41 +0100 Subject: [PATCH] Fix linker errors --- CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc3a79711..25e14f5db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -843,6 +843,17 @@ if(BUILD_TEST_SCENES) message("Building of test scenes is enabled.") endif() +include_directories(${PROJECT_SOURCE_DIR}/cmake/steam_integration) + +if(NOT LINK_STEAM_INTEGRATION) + message("Steam integration will NOT be linked. Building stubs directly.") + ## Build stubs + + list(APPEND HYPERSOMNIA_CODEBASE_CPPS + "cmake/steam_integration/steam_integration.cpp" + ) +endif() + # natvis files for easier debugging in Visual Studio. if(MSVC_SPECIFIC) @@ -1639,13 +1650,6 @@ if(LINK_STEAM_INTEGRATION) message("STEAM_INTEGRATION_LIBRARY: ${STEAM_INTEGRATION_LIBRARY}") target_link_libraries(Hypersomnia ${STEAM_INTEGRATION_LIBRARY}) -else() - message("Steam integration will NOT be linked. Building stubs directly.") - ## Build stubs - - list(APPEND HYPERSOMNIA_CODEBASE_CPPS - "cmake/steam_integration/steam_integration.cpp" - ) endif() if(BUILD_OPENGL)