CMake: Use openttd_lib split build from upstream
Add option to disable for cross-compiling
This commit is contained in:
@@ -83,5 +83,5 @@ else()
|
||||
endif()
|
||||
|
||||
if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
|
||||
target_link_libraries(openttd atomic)
|
||||
target_link_libraries(${OPENTTD_LIB} atomic)
|
||||
endif()
|
||||
|
||||
@@ -8,13 +8,13 @@ function(link_package NAME)
|
||||
# which (later) cmake considers to be an error. Work around this with by stripping the incoming string.
|
||||
if(LP_TARGET AND TARGET ${LP_TARGET})
|
||||
string(STRIP "${LP_TARGET}" LP_TARGET)
|
||||
target_link_libraries(openttd ${LP_TARGET})
|
||||
target_link_libraries(${OPENTTD_LIB} ${LP_TARGET})
|
||||
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${LP_TARGET}")
|
||||
else()
|
||||
string(STRIP "${${NAME}_LIBRARY}" ${NAME}_LIBRARY)
|
||||
string(STRIP "${${NAME}_LIBRARIES}" ${NAME}_LIBRARIES)
|
||||
include_directories(${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR})
|
||||
target_link_libraries(openttd ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
|
||||
target_link_libraries(${OPENTTD_LIB} ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
|
||||
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR} -- ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY}")
|
||||
endif()
|
||||
elseif(LP_ENCOURAGED)
|
||||
|
||||
@@ -32,7 +32,7 @@ endfunction()
|
||||
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
|
||||
#
|
||||
function(add_files)
|
||||
_add_files_tgt(openttd ${ARGV})
|
||||
_add_files_tgt(${OPENTTD_LIB} ${ARGV})
|
||||
endfunction()
|
||||
|
||||
# Add a test file to be compiled.
|
||||
@@ -44,7 +44,9 @@ endfunction()
|
||||
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
|
||||
#
|
||||
function(add_test_files)
|
||||
_add_files_tgt(openttd_test ${ARGV})
|
||||
if(NOT OPTION_NO_SPLIT_LIB)
|
||||
_add_files_tgt(openttd_test ${ARGV})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# This function works around an 'issue' with CMake, where
|
||||
|
||||
Reference in New Issue
Block a user