Skip to content

Commit 18a5cd9

Browse files
committed
(Try to) use dll import/export for variable on MSVC
CURA-13049
1 parent 8f6f71f commit 18a5cd9

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ target_link_libraries(cura-formulae-engine
8686
target_compile_definitions(cura-formulae-engine
8787
INTERFACE
8888
CURA_FORMULA_VERSION_VERSION="${CURA_FORMULA_VERSION_VERSION}"
89+
CURA_FORMULAE_ENGINE_EXPORT=1
8990
)
9091

9192
target_include_directories(
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
#ifdef _WIN32
4+
# ifdef CURA_FORMULAE_ENGINE_EXPORT
5+
# define CURA_FORMULAE_ENGINE_API __declspec(dllexport)
6+
# else
7+
# define CURA_FORMULAE_ENGINE_API __declspec(dllimport)
8+
# endif
9+
#else
10+
# define CURA_FORMULAE_ENGINE_API
11+
#endif
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#pragma once
22

33
#include "cura-formulae-engine/ast/ast.h"
4+
#include "cura-formulae-engine/config.h"
45

56
namespace CuraFormulaeEngine::env
67
{
78

89
/**
910
* @brief The standard environment.
1011
*/
11-
extern const EnvironmentMap std_env;
12+
CURA_FORMULAE_ENGINE_API extern const EnvironmentMap std_env;
1213

1314
} // namespace CuraFormulaeEngine::env

src/env/env.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace CuraFormulaeEngine::env
3535
/**
3636
* @brief The standard environment.
3737
*/
38-
const EnvironmentMap std_env = []()
38+
CURA_FORMULAE_ENGINE_API const EnvironmentMap std_env = []()
3939
{
4040
EnvironmentMap env;
4141

0 commit comments

Comments
 (0)