Keep CMakeCache.txt in between build script invocation to speed things up. Correct typo error.

This commit is contained in:
Wei Tjong Yao 2013-09-26 20:56:42 +00:00
Родитель 4b9f241065
Коммит 09ba853aba
12 изменённых файлов: 47 добавлений и 64 удалений

Просмотреть файл

@ -142,6 +142,9 @@ else ()
if (ANDROID)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -fstack-protector")
if (ENABLE_64BIT)
# For now just reference it to suppress "unused variable" warning
endif ()
elseif (NOT IOS)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -ffast-math")
@ -233,17 +236,13 @@ endfunction ()
# Override builtin function to suit our need, takes care of C flags as well as CXX flags
function (add_compiler_export_flags)
if (NOT ANDROID)
message ("--")
if (NOT ANDROID AND NOT MSVC AND NOT DEFINED USE_COMPILER_HIDDEN_VISIBILITY AND NOT DEFINED COMPILER_HAS_DEPRECATED)
message ("-- Following tests check whether compiler installed in this system has export/import and deprecated attributes support")
message ("-- CMake will generate a suitable export header file for this system based on the test result")
message ("-- It is OK to proceed to build Urho3D regardless of the test result")
endif ()
_test_compiler_hidden_visibility ()
_test_compiler_has_deprecated ()
if (NOT ANDROID)
message ("--")
endif ()
if (NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY))
# Just return if there are no flags to add.

Просмотреть файл

@ -22,6 +22,10 @@
cmake_minimum_required (VERSION 2.6.3)
if (CMAKE_TOOLCHAIN_FILE)
# Reference toolchain variable to suppress "unused variable" warning
endif()
# this one is important
set (CMAKE_SYSTEM_NAME Linux)
#this one not so much

Просмотреть файл

@ -157,15 +157,16 @@ else ()
endif ()
# Generate platform specific export header file automatically
set_target_properties (Urho3D PROPERTIES DEFINE_SYMBOL URHO3D_EXPORTS)
generate_export_header (Urho3D EXPORT_MACRO_NAME URHO3D_API EXPORT_FILE_NAME Engine/Urho3D.h.new)
# Append Urho3D license notice to the export header file
file (READ ${CMAKE_SOURCE_DIR}/Engine/Urho3D.h.in LICENSE)
file (READ ${CMAKE_BINARY_DIR}/Engine/Urho3D.h.new EXPORT_DEFINE)
file (WRITE ${CMAKE_BINARY_DIR}/Engine/Urho3D.h.new ${LICENSE}${EXPORT_DEFINE})
# Copy the new export header file only if it is different to prevent unnecessary library rebuild
execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/Engine/Urho3D.h.new ${CMAKE_BINARY_DIR}/Engine/Urho3D.h)
file (REMOVE ${CMAKE_BINARY_DIR}/Engine/Urho3D.h.new)
if (NOT URHO3D_BUILD_TYPE STREQUAL URHO3D_EXPORTS_BUILD_TYPE OR ${CMAKE_SOURCE_DIR}/Engine/Urho3D.h.in IS_NEWER_THAN ${CMAKE_BINARY_DIR}/Engine/Urho3D.h)
set_target_properties (Urho3D PROPERTIES DEFINE_SYMBOL URHO3D_EXPORTS)
generate_export_header (Urho3D EXPORT_MACRO_NAME URHO3D_API EXPORT_FILE_NAME Engine/Urho3D.h)
set (URHO3D_EXPORTS_BUILD_TYPE ${URHO3D_BUILD_TYPE} CACHE INTERNAL "Build type when Urho3D export header was last generated")
# Append Urho3D license notice to the export header file
file (READ ${CMAKE_BINARY_DIR}/Engine/Urho3D.h EXPORT_DEFINE)
configure_file (${CMAKE_SOURCE_DIR}/Engine/Urho3D.h.in ${CMAKE_BINARY_DIR}/Engine/Urho3D.h)
endif ()
# Reference supported build options that are potentially not being referenced due to platform or build type branching to suppress "unused variable" warning
if (ENABLE_SAMPLES AND ENABLE_EXTRAS AND ENABLE_TOOLS AND ENABLE_MINIDUMPS AND ENABLE_SAFE_LUA AND USE_MKLINK AND USE_STATIC_RUNTIME AND SCP_TO_TARGET AND ANDROID_ABI)
endif()

Просмотреть файл

@ -24,3 +24,4 @@
#pragma warning(disable: 4251)
#pragma warning(disable: 4275)
#endif
@EXPORT_DEFINE@

Просмотреть файл

@ -171,12 +171,12 @@ void LuaScript::ScriptSubscribeToEvent(const String& eventName, const String& fu
{
StringHash eventType(eventName);
LuaFunction* luaFunciton = GetFunction(functionName);
if (luaFunciton)
LuaFunction* luaFunction = GetFunction(functionName);
if (luaFunction)
{
SubscribeToEvent(eventType, HANDLER(LuaScript, HandleEvent));
eventTypeToFunctionMap_[eventType] = luaFunciton;
eventTypeToFunctionMap_[eventType] = luaFunction;
}
}

Просмотреть файл

@ -70,7 +70,7 @@ public:
/// Return Lua state.
lua_State* GetState() const { return luaState_; }
/// Return Lua function.
LuaFunction* GetFunction(const String& funcitonName, bool silentIfNotfound = false);
LuaFunction* GetFunction(const String& functionName, bool silentIfNotfound = false);
private:
/// Register loader.

10
Source/ThirdParty/SDL/CMakeLists.txt поставляемый
Просмотреть файл

@ -54,10 +54,11 @@ else ()
endif ()
include_directories (${X11_INCLUDE_DIRS})
message ("--")
message ("-- Following tests check whether X11 library installed in this system uses _Xconst in below functions")
message ("-- A failed test result simply means the installed X11 library does not use _Xconst")
message ("-- It is OK to proceed to build Urho3D regardless of the test result")
if (NOT DEFINED HAVE_CONST_XEXT_ADDDISPLAY)
message ("-- Following tests check whether X11 library installed in this system uses _Xconst in below functions")
message ("-- A failed test result simply means the installed X11 library does not use _Xconst")
message ("-- It is OK to proceed to build Urho3D regardless of the test result")
endif ()
include (CheckCSourceCompiles)
set (CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
check_c_source_compiles ("
@ -78,7 +79,6 @@ else ()
add_definitions (-DSDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
endif ()
set (CMAKE_REQUIRED_LIBRARIES)
message ("--")
file (GLOB VIDEO_DRIVER_C_FILES src/video/x11/*.c)
endif ()

Просмотреть файл

@ -22,10 +22,6 @@
@echo off
:: Define USE_MKLINK to 1 to enable out-of-source build and symbolic linking of resources from Bin directory
if exist CMakeCache.txt. del /F CMakeCache.txt
if exist Source\Android\CMakeCache.txt. del /F Source\Android\CMakeCache.txt
if exist CMakeFiles. rd /S /Q CMakeFiles
if exist Source\Android\CMakeFiles. rd /S /Q Source\Android\CMakeFiles
set "build=Source\Android"
set "source=.."
set "use_mklink="
@ -37,15 +33,19 @@ if not "%1" == "" (
goto loop
)
if "%use_mklink%" == "1" (
:: Remove cache file from opposite build directory
if exist Source\Android\CMakeCache.txt. del /F Source\Android\CMakeCache.txt
if exist Source\Android\CMakeFiles. rd /S /Q Source\Android\CMakeFiles
cmake -E make_directory android-Build
if exist android-Build\CMakeCache.txt. del /F android-Build\CMakeCache.txt
if exist android-Build\CMakeFiles. rd /S /Q android-Build\CMakeFiles
set "build=android-Build"
set "source=..\Source"
for %%d in (CoreData Data) do mklink /D "Source\Android\assets\%%d" "..\..\..\Bin\%%d"
for %%d in (src res assets) do mklink /D "android-Build\%%d" "..\Source\Android\%%d"
for %%f in (AndroidManifest.xml build.xml project.properties) do mklink "android-Build\%%f" "..\Source\Android\%%f"
)
) else (
if exist android-Build\CMakeCache.txt. del /F android-Build\CMakeCache.txt
if exist android-Build\CMakeFiles. rd /S /Q android-Build\CMakeFiles
)
cmake -E copy_if_different Docs\Doxyfile.in Doxyfile
echo on
cmake -E chdir %build% cmake -G "Unix Makefiles" -DANDROID=1 -DCMAKE_TOOLCHAIN_FILE=%source%\CMake\Toolchains\android.toolchain.cmake -DLIBRARY_OUTPUT_PATH_ROOT=. %* %source%

Просмотреть файл

@ -104,12 +104,6 @@ cmake -E make_directory Build
[ $RASPI_TOOL ] && cmake -E make_directory raspi-Build
[ $ANDROID_NDK ] && cmake -E make_directory android-Build
# Remove existing CMake cache and rules
rm -rf {Build,raspi-Build,android-Build}/CMakeCache.txt {Build,raspi-Build,android-Build}/CMakeFiles
# Do cleanup a few more times for old build directory created by previous version of cmake_gcc.sh, just in case
rm -rf {.,build,Android}/CMakeCache.txt {.,build,Android}/CMakeFiles
rm -rf {../build,../raspi-build,../android-build}/CMakeCache.txt {../build,../raspi-build,../android-build}/CMakeFiles
# Add support for Eclipse IDE
IFS=#
GENERATOR="Unix Makefiles"
@ -118,7 +112,7 @@ GENERATOR="Unix Makefiles"
# Add support for both native and cross-compiling build for Raspberry Pi
[[ $( uname -m ) =~ ^armv6 ]] && PLATFORM="-DRASPI=1"
# Create project with the respective Cmake generators
# Create project with the respective CMake generators
OPT=
msg "Native build" && cmake -E chdir Build cmake $OPT -G $GENERATOR $PLATFORM $@ $SOURCE && post_cmake Build
[ $RASPI_TOOL ] && msg "Raspberry Pi build" && cmake -E chdir raspi-Build cmake $OPT -G $GENERATOR -DRASPI=1 -DCMAKE_TOOLCHAIN_FILE=$SOURCE/CMake/Toolchains/raspberrypi.toolchain.cmake $@ $SOURCE && post_cmake raspi-Build

Просмотреть файл

@ -22,21 +22,17 @@
# Ensure we are in project root directory
cd $( dirname $0 )
SOURCE=`pwd`/Source
# Create out-of-source build directory
cmake -E make_directory Build
# Remove existing CMake cache and rules
rm -rf Build/CMakeCache.txt Build/CMakeFiles
# Do cleanup one more time for old build directory created by previous version of cmake_macosx.sh, just in case
rm -rf {../build,.,build}/CMakeCache.txt {../build,.,build}/CMakeFiles
SOURCE=`pwd`/Source
BUILD=Build
if [ $1 == "-DIOS=1" ]; then
BUILD=ios-Build
fi
cmake -E make_directory $BUILD
# Create project with the Xcode generator
cmake -E chdir Build cmake -G "Xcode" $@ $SOURCE
# Below temporary fix may no longer be required by newer version of CMake
sed -i.bak 's/lastKnownFileType = sourcecode; name = "as_callfunc_arm_xcode.S"/lastKnownFileType = sourcecode.asm; name = "as_callfunc_arm_xcode.S"/g' Build/*.xcodeproj/project.pbxproj
cmake -E chdir $BUILD cmake -G "Xcode" $@ $SOURCE
# Apple always uses OpenGL
sed 's/OpenGL/Direct3D9/g' Docs/Doxyfile.in >Doxyfile
@ -44,8 +40,8 @@ sed 's/OpenGL/Direct3D9/g' Docs/Doxyfile.in >Doxyfile
if [ $1 == "-DIOS=1" ]; then
# Due to a bug in the CMake/Xcode generator where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
# below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
sed -i.bak 's/\/Contents\/MacOS//g' Build/CMakeScripts/XCODE_DEPEND_HELPER.make
echo -e "\tsed -i.bak 's/\/Contents\/MacOS//g' CMakeScripts/XCODE_DEPEND_HELPER.make" >> Build/CMakeScripts/ReRunCMake.make
sed -i.bak 's/\/Contents\/MacOS//g' $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make
echo -e "\tsed -i.bak 's/\/Contents\/MacOS//g' CMakeScripts/XCODE_DEPEND_HELPER.make" >> $BUILD/CMakeScripts/ReRunCMake.make
fi
# vi: set ts=4 sw=4 expandtab:

Просмотреть файл

@ -22,12 +22,6 @@
@echo off
cmake -E make_directory Build
if exist CMakeCache.txt. del /F CMakeCache.txt
if exist Build\CMakeCache.txt. del /F Build\CMakeCache.txt
if exist Source\CMakeCache.txt. del /F Source\CMakeCache.txt
if exist CMakeFiles. rd /S /Q CMakeFiles
if exist Build\CMakeFiles. rd /S /Q Build\CMakeFiles
if exist Source\CMakeFiles. rd /S /Q Source\CMakeFiles
cmake -E copy_if_different Docs\Doxyfile.in Doxyfile
echo on
cmake -E chdir Build cmake -G "MinGW Makefiles" %* ..\Source

Просмотреть файл

@ -22,12 +22,6 @@
@echo off
cmake -E make_directory Build
if exist Build\CMakeCache.txt. del /F Build\CMakeCache.txt
if exist Source\CMakeCache.txt. del /F Source\CMakeCache.txt
if exist CMakeCache.txt del /F CMakeCache.txt
if exist Build\CMakeFiles. rd /S /Q Build\CMakeFiles
if exist Source\CMakeFiles. rd /S /Q Source\CMakeFiles
if exist CMakeFiles. rd /S /Q CMakeFiles.
set "arch="
set "version=9 2008"
:loop