shithub: cstory

Download patch

ref: 0aa65f7cd30862aedb3044bbf2b8b0caf7e74023
parent: eaef25d5dad09b1b1d4a5862abe6da94672e1c68
author: Clownacy <[email protected]>
date: Sun Apr 5 12:58:52 EDT 2020

Fix pkg-config static linking

For some reason, [LIB]_STATIC_LINK_LIBRARIES is blank. Thanks a lot,
CMake.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -439,11 +439,11 @@
 		if (PKG_CONFIG_STATIC_LIBS)
 			message(STATUS "Using system GLFW3 (pkg-config, static)")
 			target_compile_options(CSE2 PRIVATE ${glfw3_STATIC_CFLAGS})
-			target_link_libraries(CSE2 PRIVATE ${glfw3_STATIC_LINK_LIBRARIES})
+			target_link_libraries(CSE2 PRIVATE ${glfw3_STATIC_LDFLAGS})
 		else()
 			message(STATUS "Using system GLFW3 (pkg-config, dynamic)")
 			target_compile_options(CSE2 PRIVATE ${glfw3_CFLAGS})
-			target_link_libraries(CSE2 PRIVATE ${glfw3_LINK_LIBRARIES})
+			target_link_libraries(CSE2 PRIVATE ${glfw3_LDFLAGS})
 		endif()
 	elseif(TARGET glfw)
 		# CMake
@@ -475,11 +475,11 @@
 		if (PKG_CONFIG_STATIC_LIBS)
 			message(STATUS "Using system SDL2 (pkg-config, static)")
 			target_compile_options(CSE2 PRIVATE ${sdl2_STATIC_CFLAGS})
-			target_link_libraries(CSE2 PRIVATE ${sdl2_STATIC_LINK_LIBRARIES})
+			target_link_libraries(CSE2 PRIVATE ${sdl2_STATIC_LDFLAGS})
 		else()
 			message(STATUS "Using system SDL2 (pkg-config, dynamic)")
 			target_compile_options(CSE2 PRIVATE ${sdl2_CFLAGS})
-			target_link_libraries(CSE2 PRIVATE ${sdl2_LINK_LIBRARIES})
+			target_link_libraries(CSE2 PRIVATE ${sdl2_LDFLAGS})
 		endif()
 	elseif(TARGET SDL2::SDL2)
 		# CMake-generated config (Arch, vcpkg, Raspbian)
@@ -519,11 +519,11 @@
 	if (PKG_CONFIG_STATIC_LIBS)
 		message(STATUS "Using system FreeType (pkg-config, static)")
 		target_compile_options(CSE2 PRIVATE ${freetype2_STATIC_CFLAGS})
-		target_link_libraries(CSE2 PRIVATE ${freetype2_STATIC_LINK_LIBRARIES})
+		target_link_libraries(CSE2 PRIVATE ${freetype2_STATIC_LDFLAGS})
 	else()
 		message(STATUS "Using system FreeType (pkg-config, dynamic)")
 		target_compile_options(CSE2 PRIVATE ${freetype2_CFLAGS})
-		target_link_libraries(CSE2 PRIVATE ${freetype2_LINK_LIBRARIES})
+		target_link_libraries(CSE2 PRIVATE ${freetype2_LDFLAGS})
 	endif()
 elseif(FREETYPE_FOUND)
 	message(STATUS "Using system FreeType (CMake)")
--- a/DoConfig/CMakeLists.txt
+++ b/DoConfig/CMakeLists.txt
@@ -95,11 +95,11 @@
 	if (PKG_CONFIG_STATIC_LIBS)
 		message(STATUS "Using system GLFW3 (pkg-config, static)")
 		target_compile_options(DoConfig PRIVATE ${glfw3_STATIC_CFLAGS})
-		target_link_libraries(DoConfig PRIVATE ${glfw3_STATIC_LINK_LIBRARIES})
+		target_link_libraries(DoConfig PRIVATE ${glfw3_STATIC_LDFLAGS})
 	else()
 		message(STATUS "Using system GLFW3 (pkg-config, dynamic)")
 		target_compile_options(DoConfig PRIVATE ${glfw3_CFLAGS})
-		target_link_libraries(DoConfig PRIVATE ${glfw3_LINK_LIBRARIES})
+		target_link_libraries(DoConfig PRIVATE ${glfw3_LDFLAGS})
 	endif()
 elseif(TARGET glfw)
 	# CMake