Skip to content

Commit c161cae

Browse files
committed
Need a fallback for target_link_options due to too old CMake version
1 parent 26c7769 commit c161cae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/build-runtime.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ add_executable(runtime ${CMAKE_CURRENT_BINARY_DIR}/runtime.4.o notify.c)
110110
# CMake gets confused by the .o object, therefore we need to tell it that it shall link everything using the C compiler
111111
set_property(TARGET runtime PROPERTY LINKER_LANGUAGE C)
112112
target_link_libraries(runtime PRIVATE libsquashfuse dl xz libzlib pthread libappimage_shared libappimage_hashlib)
113-
target_link_options(runtime PRIVATE ${runtime_ldflags})
113+
if(COMMAND target_link_options)
114+
target_link_options(runtime PRIVATE ${runtime_ldflags})
115+
else()
116+
set_property(TARGET runtime PROPERTY LINK_FLAGS ${runtime_ldflags})
117+
endif()
114118
target_include_directories(runtime PRIVATE ${PROJECT_SOURCE_DIR}/include)
115119

116120
if(BUILD_DEBUG)

0 commit comments

Comments
 (0)