1
0
Fork 0

CMake: make another object dependency explicit

Since we’re not using target_link_libraries, we need to explicitly
define fgfsObjects (which contains main.cxx) as depending on the
embedded resources target.
This commit is contained in:
James Turner 2021-03-10 10:17:15 +00:00
parent 9fc45e598f
commit 026b02d7e9
2 changed files with 7 additions and 1 deletions

View file

@ -495,6 +495,8 @@ include(SetupFGFSLibraries)
add_library(fgfsObjects OBJECT flightgear-version) add_library(fgfsObjects OBJECT flightgear-version)
add_dependencies(fgfsObjects buildId) add_dependencies(fgfsObjects buildId)
# remove once we use CMake 3.12, since then the dependency will be explicit
add_dependencies(fgfsObjects fgembeddedresources)
######################################################################## ########################################################################

View file

@ -34,7 +34,11 @@ add_custom_command(
add_library(fgembeddedresources STATIC add_library(fgembeddedresources STATIC
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.cxx ${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.cxx
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx) ${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx
)
# users of the library include this as <EmbeddedResources/FlightGear-resources.hxx>
target_include_directories(fgembeddedresources INTERFACE ${CMAKE_BINARY_DIR}/src)
target_link_libraries(fgembeddedresources SimGearCore) target_link_libraries(fgembeddedresources SimGearCore)