mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-07-02 00:22:10 -05:00
Enable use of obs-module-helper.hpp in tests
This commit is contained in:
parent
7914f75876
commit
8c0be8011d
|
|
@ -1,6 +1,9 @@
|
|||
#include "obs-module-helper.hpp"
|
||||
#ifndef UNIT_TEST
|
||||
#include "switcher-data.hpp"
|
||||
#endif
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
const char *obs_module_text(const char *text)
|
||||
{
|
||||
if (!advss::switcher) {
|
||||
|
|
@ -16,3 +19,15 @@ obs_module_t *obs_current_module()
|
|||
}
|
||||
return advss::switcher->GetModule();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
const char *obs_module_text(const char *text)
|
||||
{
|
||||
return text;
|
||||
};
|
||||
obs_module_t *obs_current_module()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
#pragma once
|
||||
#ifndef UNIT_TEST
|
||||
#include <obs-module.h>
|
||||
#else
|
||||
typedef struct obs_module obs_module_t;
|
||||
#endif
|
||||
|
||||
const char *obs_module_text(const char *text);
|
||||
obs_module_t *obs_current_module();
|
||||
|
|
|
|||
|
|
@ -5,13 +5,17 @@ get_target_property(ADVSS_SOURCE_DIR advanced-scene-switcher-lib SOURCE_DIR)
|
|||
add_executable(${PROJECT_NAME})
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE UNIT_TEST)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
|
||||
target_sources(${PROJECT_NAME}
|
||||
PRIVATE tests.cpp ${ADVSS_SOURCE_DIR}/src/utils/math-helpers.cpp)
|
||||
|
||||
target_sources(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE tests.cpp ${ADVSS_SOURCE_DIR}/src/utils/math-helpers.cpp
|
||||
${ADVSS_SOURCE_DIR}/src/utils/obs-module-helper.cpp)
|
||||
target_include_directories(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE "${ADVSS_SOURCE_DIR}/src" "${ADVSS_SOURCE_DIR}/src/legacy"
|
||||
"${ADVSS_SOURCE_DIR}/src/macro-core" "${ADVSS_SOURCE_DIR}/src/utils"
|
||||
"${ADVSS_SOURCE_DIR}/forms" "${ADVSS_SOURCE_DIR}/deps/exprtk")
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(${PROJECT_NAME} PUBLIC /MP /d2FH4- /wd4267 /wd4267
|
||||
/bigobj)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user