Browse Source

Copy D3DCompiler DLL to output folder for AtomicEditor, AtomicTool, and JSBind

JoshEngebretson 10 years ago
parent
commit
bb68a7b068

+ 2 - 0
CMake/Modules/AtomicWindows.cmake

@@ -4,6 +4,8 @@ include(AtomicDesktop)
 
 set (CMAKE_DEBUG_POSTFIX _d)
 
+set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x64/D3DCompiler_47.dll)
+
 add_definitions(-DATOMIC_PLATFORM_WINDOWS -D_CRT_SECURE_NO_WARNINGS -DATOMIC_TBUI)
 
 list (APPEND ATOMIC_LINK_LIBRARIES MojoShader user32 gdi32 winmm imm32 ole32 oleaut32 version uuid d3d9 d3dcompiler Ws2_32)

+ 6 - 0
Source/AtomicEditor/CMakeLists.txt

@@ -35,6 +35,12 @@ elseif(LINUX)
     target_link_libraries(AtomicEditor curl nativefiledialog ${GTK3_LIBRARIES})
 else()
     target_link_libraries(AtomicEditor libcurl Iphlpapi Wldap32)
+    
+    # pre-Windows 8 can't count on D3DCompiler_47.dll being on system
+    add_custom_command (TARGET AtomicEditor POST_BUILD
+    COMMAND ${CMAKE_COMMAND}
+    ARGS -E copy \"${D3DCOMPILER_47_DLL}\" \"$<TARGET_FILE_DIR:AtomicEditor>/D3DCompiler_47.dll\")
+
 endif()
 
 if (TARGET_PROPERTIES)

+ 13 - 1
Source/AtomicJS/JSBind/CMakeLists.txt

@@ -11,7 +11,19 @@ add_executable(JSBind ${SOURCE_FILES})
 
 target_link_libraries(JSBind ${ATOMIC_LINK_LIBRARIES})
 
+if (MSVC)
+    # pre-Windows 8 can't count on D3DCompiler_47.dll being on system
+    # TODO: Remove this dependency
+    add_custom_command (TARGET JSBind POST_BUILD
+    COMMAND ${CMAKE_COMMAND}
+    ARGS -E copy \"${D3DCOMPILER_47_DLL}\" \"$<TARGET_FILE_DIR:JSBind>/D3DCompiler_47.dll\")
+endif()
+
 #TODO: finer grained dependencies
 add_custom_command(TARGET JSBind POST_BUILD
                    COMMAND $<TARGET_FILE:JSBind> "\"${CMAKE_SOURCE_DIR}\"" "${JAVASCRIPT_BINDINGS_PLATFORM}"
-                   COMMENT "Generating Javascript Bindings")
+                   COMMENT "Generating Javascript Bindings")
+                   
+                   
+        
+                   

+ 7 - 0
Source/AtomicTool/CMakeLists.txt

@@ -12,6 +12,13 @@ add_dependencies(AtomicTool AtomicEditor)
 
 if (MSVC)
     target_link_libraries(AtomicTool libcurl Iphlpapi Wldap32)
+    
+    # pre-Windows 8 can't count on D3DCompiler_47.dll being on system
+    # TODO: Remove this dependency
+    add_custom_command (TARGET AtomicTool POST_BUILD
+    COMMAND ${CMAKE_COMMAND}
+    ARGS -E copy \"${D3DCOMPILER_47_DLL}\" \"$<TARGET_FILE_DIR:AtomicTool>/D3DCompiler_47.dll\")
+    
 else()
     target_link_libraries(AtomicTool curl)
 endif()