Fixed slow compilation on Android
This commit is contained in:
@@ -183,10 +183,10 @@ include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include)
|
||||
include(MSVCFilters)
|
||||
|
||||
if(ANDROID)
|
||||
add_library(openttd SHARED ${GENERATED_SOURCE_FILES})
|
||||
target_link_libraries(openttd log z)
|
||||
add_library(openttd SHARED ${GENERATED_SOURCE_FILES})
|
||||
target_link_libraries(openttd log z)
|
||||
else()
|
||||
add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
|
||||
add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
|
||||
endif()
|
||||
|
||||
set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
|
||||
@@ -213,6 +213,11 @@ if(IPO_FOUND)
|
||||
endif()
|
||||
set_target_properties(openttd PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
|
||||
process_compile_flags()
|
||||
if(ANDROID)
|
||||
# A bug in Android NDK r22: https://github.com/android/ndk/issues/1418
|
||||
#get_source_file_property(TMP_CFLAGS ${CMAKE_SOURCE_DIR}/src/settings.cpp COMPILE_FLAGS)
|
||||
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/settings.cpp PROPERTIES COMPILE_FLAGS "-O1")
|
||||
endif()
|
||||
|
||||
include(LinkPackage)
|
||||
link_package(PNG TARGET PNG::PNG ENCOURAGED)
|
||||
|
||||
Reference in New Issue
Block a user