Skip to content

Commit 0aa073c

Browse files
committed
Cpp: Remove deprecated policy settings
Setting any policy to the OLD behavior is almost always a bad idea in the long run as the OLD behavior of cmake policies are deprecated by definition and may be completely removed in a future cmake version. The changes in cmake behavior introduced by this are - Only auto-expand variables in if-expressions, if they are unquoted. Doing this differently just opens you up for hell to break loose. As far as I can tell, we don't make use of this behavior anyway. - If referring to a non-existing target with get_target_properties, cmake will now produce an error. This is what one usually wants as referencing non-existing targets is simply a bug in your setup. - cmake won't recognize "DEFINITIONS" as a built-in directory property. Instead, one has to use the (proper) "COMPILE_DEFINITIONS". Again, I was unable to find a location in which we use "DEFINITIONS", so the change should have no effect on us. - "@rpath" can now be used in a target's install name on macOS. With the OLD behavior, this had to explicitly be enabled, while the new behavior is to enable this by default. Since we don't seem to be using "@rpath" in any cmake files, this should not have any effect on us. Besides removing deprecated behavior, this has the nice side effect of removing the warnings that were emitted when building the cpp runtime with cmake. Signed-off-by: Robert Adam <[email protected]>
1 parent d93fbbb commit 0aa073c

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

runtime/Cpp/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ endif(WITH_STATIC_CRT)
3636

3737
project(LIBANTLR4)
3838

39-
CMAKE_POLICY(SET CMP0054 OLD)
40-
CMAKE_POLICY(SET CMP0045 OLD)
41-
CMAKE_POLICY(SET CMP0042 OLD)
42-
43-
CMAKE_POLICY(SET CMP0059 OLD)
44-
CMAKE_POLICY(SET CMP0054 OLD)
45-
4639
if(APPLE)
4740
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
4841
endif()

0 commit comments

Comments
 (0)