build: fix link error on MSVC for SFML port
Change two `constexpr` declarations to `inline` to fix a link error on MSVC. Also remove the C++14 override that was used for testing on MSVC, the project being defined as C++17 in CMake. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
0aecfb5d1b
commit
18c3c3bd51
|
@ -68,8 +68,6 @@ if(CMAKE_VERSION VERSION_LESS "3.25")
|
|||
endif()
|
||||
endif()
|
||||
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/std:c++14>)
|
||||
|
||||
set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "" FORCE)
|
||||
|
||||
# We need to explicitly set all of these to override the CMake defaults.
|
||||
|
|
|
@ -266,6 +266,10 @@ constexpr Angle operator""_rad(unsigned long long angle)
|
|||
|
||||
// Note: the 'inline' keyword here is technically not required, but VS2019 fails
|
||||
// to compile with a bogus "multiple definition" error if not explicitly used.
|
||||
#ifdef _MSC_VER
|
||||
inline constexpr Angle Angle::Zero;
|
||||
#else
|
||||
constexpr Angle Angle::Zero;
|
||||
#endif
|
||||
|
||||
} // namespace sf
|
||||
|
|
|
@ -279,6 +279,10 @@ constexpr Time& operator%=(Time& left, Time right)
|
|||
|
||||
// Note: the 'inline' keyword here is technically not required, but VS2019 fails
|
||||
// to compile with a bogus "multiple definition" error if not explicitly used.
|
||||
#ifdef _MSC_VER
|
||||
inline constexpr Time Time::Zero;
|
||||
#else
|
||||
constexpr Time Time::Zero;
|
||||
#endif
|
||||
|
||||
} // namespace sf
|
||||
|
|
Loading…
Reference in New Issue