--- a/CMakeLists.txt Tue Mar 19 16:18:40 2013 +0100
+++ b/CMakeLists.txt Tue Mar 19 16:28:26 2013 +0100
@@ -254,7 +254,7 @@
add_flag_append(CMAKE_Pascal_FLAGS "-vm4079,4080,4081 -Cs2000000 -vewnq")
add_flag_append(CMAKE_Pascal_FLAGS_DEBUG "-O- -g -gl -gv")
-add_flag_append(CMAKE_Pascal_FLAGS_RELEASE "-Os -Xs -Si")
+add_flag_append(CMAKE_Pascal_FLAGS_RELEASE "-Os -Xs")
#get BUILD_TYPE and enable/disable optimisation
message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
--- a/hedgewars/CMakeLists.txt Tue Mar 19 16:18:40 2013 +0100
+++ b/hedgewars/CMakeLists.txt Tue Mar 19 16:28:26 2013 +0100
@@ -124,6 +124,9 @@
#when cmake-2.6 support is dropped, this ought to be inside FindFreePascal.cmake
if (FREEPASCAL_VERSION VERSION_LESS required_fpc_version)
message(FATAL_ERROR "Freepascal ${FREEPASCAL_VERSION} is too old, minimum version required is ${required_fpc_version}")
+elseif(FREEPASCAL_VERSION VERSION_GREATER 2.4)
+ #enable INLINE only with a recent version of fpc
+ add_flag_append(CMAKE_Pascal_FLAGS_RELEASE -Si)
endif()
@@ -220,9 +223,5 @@
if(APPLE)
target_link_libraries(hwengine SDLmain)
endif()
-#this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
-#if((FREEPASCAL_VERSION VERSION_LESS "2.6") AND (NOT ${FFMPEG_FOUND}))
-# add_dependencies(hwengine ENGINECLEAN)
-#endif()
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}" DESTINATION ${destination_dir})