Browse Source

Minor tweak to link lua/luajit tool without Urho3D dependency libs.

These changes should also reduce prerequisite for building 32-bit luaJIT VM (for Android and RASPI) on 64-bit host/build system.
Yao Wei Tjong 姚伟忠 12 năm trước cách đây
mục cha
commit
327ab9af76

+ 9 - 2
Source/CMake/Modules/Urho3D-CMake-magic.cmake

@@ -433,9 +433,16 @@ macro (setup_library)
 endmacro ()
 
 # Macro for setting up an executable target
+#  NODEPS - setup executable target without defining Urho3D dependency libraries
+#  WIN32/MACOSX_BUNDLE/EXCLUDE_FROM_ALL - see CMake help on add_executable command
 macro (setup_executable)
-    add_executable (${TARGET_NAME} ${ARGN} ${SOURCE_FILES})
-    define_dependency_libs (Urho3D)
+    # Parse extra arguments
+    cmake_parse_arguments (ARG "NODEPS" "" "" ${ARGN})
+
+    add_executable (${TARGET_NAME} ${ARG_UNPARSED_ARGUMENTS} ${SOURCE_FILES})
+    if (NOT ARG_NODEPS)
+        define_dependency_libs (Urho3D)
+    endif ()
     setup_target ()
     
     if (IOS)

+ 2 - 2
Source/ThirdParty/Lua/CMakeLists.txt

@@ -48,7 +48,7 @@ if (NOT IOS AND (NOT DEFINED ENABLE_TOOLS OR ENABLE_TOOLS))
     endif ()
 
     # Setup target
-    setup_executable ()
+    setup_executable (NODEPS)
     adjust_target_name ()   # Adjust to intended target output name
 
     # Define target name for Lua compiler
@@ -61,5 +61,5 @@ if (NOT IOS AND (NOT DEFINED ENABLE_TOOLS OR ENABLE_TOOLS))
     # Same as above
 
     # Setup target
-    setup_executable ()
+    setup_executable (NODEPS)
 endif ()

+ 1 - 1
Source/ThirdParty/LuaJIT/CMakeLists.txt

@@ -285,7 +285,7 @@ if (NOT IOS AND (NOT DEFINED ENABLE_TOOLS OR ENABLE_TOOLS))
     set (LINK_LIBS_ONLY LuaJIT)
 
     # Setup target
-    setup_executable ()
+    setup_executable (NODEPS)
     adjust_target_name ()   # Adjust to intended target output name
 
     # Define post build steps

+ 1 - 1
Source/ThirdParty/LuaJIT/CMakeLists.txt-buildvm.in

@@ -47,4 +47,4 @@ set (SOURCE_FILES ${C_FILES} ${GEN_ARCH_H})
 set (INCLUDE_DIRS_ONLY ${CMAKE_CURRENT_BINARY_DIR} @CMAKE_CURRENT_SOURCE_DIR@/src)
 
 # Setup target
-setup_executable ()
+setup_executable (NODEPS)

+ 1 - 1
Source/ThirdParty/LuaJIT/CMakeLists.txt-minilua.in

@@ -34,4 +34,4 @@ if (NOT MSVC)
 endif ()
 
 # Setup target
-setup_executable ()
+setup_executable (NODEPS)

+ 1 - 1
Source/ThirdParty/toluapp/src/bin/CMakeLists.txt

@@ -18,4 +18,4 @@ set (INCLUDE_DIRS_ONLY ../../include)
 if (ENABLE_LUAJIT AND ENABLE_64BIT AND APPLE AND NOT IOS)
     setup_macosx_linker_flags (CMAKE_EXE_LINKER_FLAGS)
 endif ()
-setup_executable ()
+setup_executable (NODEPS)