Skip to content

Commit

Permalink
fix few more dlls decl
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jan 27, 2025
1 parent 08a4b49 commit e430b73
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ortools/constraint_solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ add_library(${NAME} OBJECT ${_SRCS})
set_target_properties(${NAME} PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
if(MSVC AND BUILD_SHARED_LIBS)
target_compile_definitions(${NAME} PUBLIC "OR_BUILD_DLL")
target_compile_definitions(${NAME} PRIVATE "OR_EXPORT")
endif()
target_include_directories(${NAME} PRIVATE
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion ortools/constraint_solver/constraint_solveri.h
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ class LocalSearchFilterManager : public BaseObject {
int64_t accepted_value_;
};

class IntVarLocalSearchFilter : public LocalSearchFilter {
class OR_DLL IntVarLocalSearchFilter : public LocalSearchFilter {
public:
explicit IntVarLocalSearchFilter(const std::vector<IntVar*>& vars);
~IntVarLocalSearchFilter() override;
Expand Down
4 changes: 2 additions & 2 deletions ortools/constraint_solver/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class PathsMetadata {
std::vector<int64_t> path_of_node_;
};

class RoutingModel {
class OR_DLL RoutingModel {
public:
/// Types of precedence policy applied to pickup and delivery pairs.
enum PickupAndDeliveryPolicy {
Expand Down Expand Up @@ -2837,7 +2837,7 @@ class RoutingModel {
};

/// Routing model visitor.
class RoutingModelVisitor : public BaseObject {
class OR_DLL RoutingModelVisitor : public BaseObject {
public:
/// Constraint types.
static const char kLightElement[];
Expand Down
4 changes: 4 additions & 0 deletions ortools/init/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ set_target_properties(${NAME} PROPERTIES
LINKER_LANGUAGE CXX
POSITION_INDEPENDENT_CODE ON
)
if(MSVC AND BUILD_SHARED_LIBS)
target_compile_definitions(${NAME} PUBLIC "OR_BUILD_DLL")
target_compile_definitions(${NAME} PRIVATE "OR_EXPORT")
endif()
target_include_directories(${NAME} PRIVATE
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR})
Expand Down
4 changes: 4 additions & 0 deletions ortools/linear_solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ add_library(${NAME} OBJECT ${_SRCS})
set_target_properties(${NAME} PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
if(MSVC AND BUILD_SHARED_LIBS)
target_compile_definitions(${NAME} PUBLIC "OR_BUILD_DLL")
target_compile_definitions(${NAME} PRIVATE "OR_EXPORT")
endif()
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
Expand Down
2 changes: 1 addition & 1 deletion ortools/linear_solver/linear_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ class MPConstraint {
* instead. We need to figure out how to deal with the subtleties of
* the default values.
*/
class MPSolverParameters {
class OR_DLL MPSolverParameters {
public:
/// Enumeration of parameters that take continuous values.
enum DoubleParam {
Expand Down

0 comments on commit e430b73

Please sign in to comment.