mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
build system: work around strange cmake issue
On both Mac and Linux cmake 3.12 complained that there were "no sources given to target" for the Subsurface-mobile target, which made no sense at all (easy enough to add debug output to ensure there were, in fact, sources given in the call to add_executable()). But splitting this across two lines like this seems to make it work both for older and newer cmake versions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a95e658946
commit
4012ac1c50
1 changed files with 5 additions and 1 deletions
|
@ -304,7 +304,11 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
|
|||
if(ANDROID)
|
||||
add_library(${SUBSURFACE_TARGET} SHARED ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
|
||||
else()
|
||||
add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
|
||||
# the following is split across two commands since in cmake 3.12 this would result
|
||||
# in a non-sensical "no sources given to target" error if done all as one set of
|
||||
# arguments to the add_executable() call
|
||||
add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES})
|
||||
target_sources(${SUBSURFACE_TARGET} PUBLIC ${MOBILE_SRC} ${MOBILE_RESOURCES})
|
||||
endif()
|
||||
target_link_libraries(
|
||||
${SUBSURFACE_TARGET}
|
||||
|
|
Loading…
Add table
Reference in a new issue