You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of OR-Tools and what language are you using?
Version: 9.11
Language: C++
In cpp.cmake:
target_compile_options(${PROJECT_NAME} PUBLIC ${OR_TOOLS_COMPILE_OPTIONS})
target_link_options(${PROJECT_NAME} INTERFACE ${OR_TOOLS_LINK_OPTIONS})
OR_TOOLS_COMPILE_OPTIONS are exported PUBLIC. Therefore, users of the or-tools lib are forced to used the same compiler options in there application. The options should be PRIVATE so or-tools itself is build with the required options but not the downstream application.
Also: OR_TOOLS_LINK_OPTIONS (which is only set to /WHOLEARCHIVE:ortools when MSVC is used) is exported as INTERFACE. Therefore it has no impact on the build of ortools itself but only on the users of the lib which may not want that.
I noticed this when I tried to use or-tools (compiled with MSVC) in my project which is compiled with clang. This didn't work because clang (not clang-cl) doesn't support these options.
We currently only support and test MSVC build on windows, but feel free to fix the build and send us a PR for this specific issue...
This option is mandatory with msvc since there is some singleton which will be drop without this, I don't know how clang work here especially on windows and how you integrate it with a MSBuild user project...
for compile_options is not that simple some are configure time option e.g. enabling support of SCIP solver so the -DUSE_SCIP MUST be passed to the user otherwise headers won't be parsed as expected so while maybe not ALL compile options are public some of them are mandatory so if you have time don't hesitate to split the list in two: what is only private and what should be public (aka INTERFACE+PRIVATE) and send us a PR !
What version of OR-Tools and what language are you using?
Version: 9.11
Language: C++
In
cpp.cmake
:OR_TOOLS_COMPILE_OPTIONS
are exportedPUBLIC
. Therefore, users of the or-tools lib are forced to used the same compiler options in there application. The options should bePRIVATE
so or-tools itself is build with the required options but not the downstream application.Also:
OR_TOOLS_LINK_OPTIONS
(which is only set to/WHOLEARCHIVE:ortools
when MSVC is used) is exported asINTERFACE
. Therefore it has no impact on the build of ortools itself but only on the users of the lib which may not want that.I noticed this when I tried to use or-tools (compiled with MSVC) in my project which is compiled with clang. This didn't work because clang (not clang-cl) doesn't support these options.
When changing
cpp.cmake
to:is works without a problem
The text was updated successfully, but these errors were encountered: