Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
CMake: fix generator conditional expressions
Browse files Browse the repository at this point in the history
OPENGL_LIBRARIES may contain multiple paths, separated by semicolons.
In CMake 3.22.1 this results in an improper list of libraries when
passing through a separate variable.
  • Loading branch information
sfan5 authored and SmallJoker committed Jan 21, 2024
1 parent 66786d0 commit 25a06ca
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -314,26 +314,6 @@ set(link_includes
"$<$<BOOL:${USE_X11}>:${X11_INCLUDE_DIR}>"
)

set(link_libs
"${ZLIB_LIBRARY}"
"${JPEG_LIBRARY}"
"${PNG_LIBRARY}"
"$<$<BOOL:${USE_SDL2}>:${SDL2_LIBRARIES}>"

"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
"$<$<BOOL:${OPENGLES_DIRECT_LINK}>:${OPENGLES_LIBRARY}>"
"$<$<BOOL:${OPENGLES2_DIRECT_LINK}>:${OPENGLES2_LIBRARIES}>"
${EGL_LIBRARY}

"$<$<PLATFORM_ID:Android>:-landroid -llog>"
${COCOA_LIB}
${IOKIT_LIB}
"$<$<PLATFORM_ID:Windows>:gdi32>"
"$<$<PLATFORM_ID:Windows>:winmm>"
"$<$<BOOL:${USE_X11}>:${X11_X11_LIB}>"
"$<$<BOOL:${USE_X11}>:${X11_Xi_LIB}>"
)

# Source files

set(IRRMESHLOADER
Expand Down Expand Up @@ -533,7 +513,25 @@ target_include_directories(IrrlichtMt
${link_includes}
)

target_link_libraries(IrrlichtMt PRIVATE ${link_libs})
target_link_libraries(IrrlichtMt PRIVATE
"${ZLIB_LIBRARY}"
"${JPEG_LIBRARY}"
"${PNG_LIBRARY}"
"$<$<BOOL:${USE_SDL2}>:${SDL2_LIBRARIES}>"

"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
"$<$<BOOL:${OPENGLES_DIRECT_LINK}>:${OPENGLES_LIBRARY}>"
"$<$<BOOL:${OPENGLES2_DIRECT_LINK}>:${OPENGLES2_LIBRARIES}>"
${EGL_LIBRARY}

"$<$<PLATFORM_ID:Android>:-landroid -llog>"
${COCOA_LIB}
${IOKIT_LIB}
"$<$<PLATFORM_ID:Windows>:gdi32>"
"$<$<PLATFORM_ID:Windows>:winmm>"
"$<$<BOOL:${USE_X11}>:${X11_X11_LIB}>"
"$<$<BOOL:${USE_X11}>:${X11_Xi_LIB}>"
)

if(WIN32)
target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_) # used in _IRR_DEBUG_BREAK_IF definition in a public header
Expand Down

0 comments on commit 25a06ca

Please sign in to comment.