瀏覽代碼

- Added bat, sh and hlsl files to .editorconfig
- Trimmed whitespace + fixed newlines for bat and sh files

Jorrit Rouwe 2 年之前
父節點
當前提交
0d275c9239

+ 2 - 1
.editorconfig

@@ -1,6 +1,6 @@
 root = true
 
-[*.{cpp,h,inl,cmake}]
+[*.{cpp,h,inl,cmake,sh,bat,hlsl}]
 indent_style = tab
 tab_width = 4
 trim_trailing_whitespace = true
@@ -10,3 +10,4 @@ insert_final_newline = true
 indent_style = tab
 tab_width = 4
 trim_trailing_whitespace = true
+insert_final_newline = true

+ 8 - 8
Build/CMakeLists.txt

@@ -22,8 +22,8 @@ option(BUILD_SHARED_LIBS "Compile Jolt as a shared library" OFF)
 # If you don't do this you may get an error: /usr/bin/ld: libJolt.a: error adding symbols: file format not recognized
 option(INTERPROCEDURAL_OPTIMIZATION "Enable interprocedural optimizations" ON)
 
-# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component 
-# and will enable floating point exceptions during simulation to detect divisions by zero. 
+# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component
+# and will enable floating point exceptions during simulation to detect divisions by zero.
 # Note that this currently only works using MSVC. Clang turns Float2 into a SIMD vector sometimes causing floating point exceptions (the option is ignored).
 option(FLOATING_POINT_EXCEPTIONS_ENABLED "Enable floating point exceptions" ON)
 
@@ -60,7 +60,7 @@ endif()
 if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW)
 	# Fill in the path to the asan libraries
 	set(CLANG_LIB_PATH "\"$(VSInstallDir)\\VC\\Tools\\Llvm\\x64\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\"")
-	
+
 	# 64 bit architecture
 	set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE "x64")
 
@@ -71,7 +71,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA
 
 	# Set general compiler flags
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline")
-	
+
 	# Enable warnings
 	if (ENABLE_ALL_WARNINGS)
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /WX")
@@ -195,7 +195,7 @@ set(PHYSICS_REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../)
 include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake)
 if (XCODE)
 	# Ensure that we enable SSE4.2 for the x86_64 build, XCode builds multiple architectures
-	set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt") 
+	set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt")
 endif()
 
 # Install Jolt library and includes
@@ -208,7 +208,7 @@ foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES})
 	endif()
 endforeach()
 
-# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library 
+# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library
 if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
 	# Ability to turn ON/OFF individual applications
 	option(TARGET_UNIT_TESTS "Build Unit Tests" ON)
@@ -265,7 +265,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
 				target_link_options(PerformanceTest PUBLIC "/SUBSYSTEM:CONSOLE")
 			endif()
 			set_property(TARGET PerformanceTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PHYSICS_REPO_ROOT}")
-			
+
 			# Copy the assets folder
 			add_custom_command(TARGET PerformanceTest PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${PHYSICS_REPO_ROOT}/Assets/ $<TARGET_FILE_DIR:PerformanceTest>/Assets/)
 		   endif()
@@ -283,4 +283,4 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
 			include(${PHYSICS_REPO_ROOT}/JoltViewer/JoltViewer.cmake)
 		endif()
 	endif()
-endif()
+endif()

+ 3 - 3
Build/cmake_linux_clang_gcc.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ -z $1 ] 
+if [ -z $1 ]
 then
 	BUILD_TYPE=Debug
 else
@@ -8,7 +8,7 @@ else
 	shift
 fi
 
-if [ -z $1 ] 
+if [ -z $1 ]
 then
 	COMPILER=clang++
 else
@@ -25,4 +25,4 @@ echo Generating Makefile for build type \"$BUILD_TYPE\" and compiler \"$COMPILER
 
 cmake -S . -B $BUILD_DIR -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=$COMPILER "${@}"
 
-echo Compile by running \"make -j 8 \&\& ./UnitTests\" in folder \"$BUILD_DIR\"
+echo Compile by running \"make -j 8 \&\& ./UnitTests\" in folder \"$BUILD_DIR\"

+ 1 - 1
Build/cmake_linux_mingw.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ -z $1 ] 
+if [ -z $1 ]
 then
 	BUILD_TYPE=Release
 else

+ 2 - 2
Build/cmake_vs2019_cl.bat

@@ -1,3 +1,3 @@
 @echo off
-cmake -S . -B VS2019_CL -G "Visual Studio 16 2019" -A x64
-echo Open VS2019_CL\JoltPhysics.sln to build the project.
+cmake -S . -B VS2019_CL -G "Visual Studio 16 2019" -A x64 %*
+echo Open VS2019_CL\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2019_cl_arm.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2019_CL_ARM -G "Visual Studio 16 2019" -A ARM64 %*
-echo Open VS2019_CL_ARM\JoltPhysics.sln to build the project.
+echo Open VS2019_CL_ARM\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2019_cl_arm_32bit.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2019_CL_ARM_32BIT -G "Visual Studio 16 2019" -A ARM %*
-echo Open VS2019_CL_ARM_32BIT\JoltPhysics.sln to build the project.
+echo Open VS2019_CL_ARM_32BIT\JoltPhysics.sln to build the project.

+ 2 - 2
Build/cmake_vs2019_clang.bat

@@ -1,5 +1,5 @@
 @echo off
-cmake -S . -B VS2019_Clang -G "Visual Studio 16 2019" -A x64 -T ClangCL
+cmake -S . -B VS2019_Clang -G "Visual Studio 16 2019" -A x64 -T ClangCL %*
 echo:
 echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 echo Make sure to install:
@@ -7,4 +7,4 @@ echo - C++ Clang Compiler for Windows 11.0.0+
 echo - C++ Clang-cl for v142+ build tools (x64/x86)
 echo Using the Visual Studio Installer
 echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-echo Open VS2019_Clang/JoltPhysics.sln to build the project.
+echo Open VS2019_Clang/JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_cl.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2022_CL -G "Visual Studio 17 2022" -A x64 %*
-echo Open VS2022_CL\JoltPhysics.sln to build the project.
+echo Open VS2022_CL\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_cl_32bit.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2022_CL_32BIT -G "Visual Studio 17 2022" -A Win32 -DUSE_SSE4_1=OFF -DUSE_SSE4_2=OFF -DUSE_AVX=OFF -DUSE_AVX2=OFF -DUSE_AVX512=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF %*
-echo Open VS2022_CL_32BIT\JoltPhysics.sln to build the project.
+echo Open VS2022_CL_32BIT\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_cl_arm.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2022_CL_ARM -G "Visual Studio 17 2022" -A ARM64 %*
-echo Open VS2022_CL_ARM\JoltPhysics.sln to build the project.
+echo Open VS2022_CL_ARM\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_cl_arm_32bit.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2022_CL_ARM_32BIT -G "Visual Studio 17 2022" -A ARM %*
-echo Open VS2022_CL_ARM_32BIT\JoltPhysics.sln to build the project.
+echo Open VS2022_CL_ARM_32BIT\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_cl_double.bat

@@ -1,3 +1,3 @@
 @echo off
 cmake -S . -B VS2022_CL_Double -G "Visual Studio 17 2022" -A x64 -DDOUBLE_PRECISION=ON %*
-echo Open VS2022_CL_Double\JoltPhysics.sln to build the project.
+echo Open VS2022_CL_Double\JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_clang.bat

@@ -7,4 +7,4 @@ echo - C++ Clang Compiler for Windows 12.0.0+
 echo - C++ Clang-cl for v143+ build tools (x64/x86)
 echo Using the Visual Studio Installer
 echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-echo Open VS2022_Clang/JoltPhysics.sln to build the project.
+echo Open VS2022_Clang/JoltPhysics.sln to build the project.

+ 1 - 1
Build/cmake_vs2022_clang_double.bat

@@ -7,4 +7,4 @@ echo - C++ Clang Compiler for Windows 12.0.0+
 echo - C++ Clang-cl for v143+ build tools (x64/x86)
 echo Using the Visual Studio Installer
 echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-echo Open VS2022_Clang_Double/JoltPhysics.sln to build the project.
+echo Open VS2022_Clang_Double/JoltPhysics.sln to build the project.

+ 2 - 2
Build/cmake_vs2022_uwp.bat

@@ -1,5 +1,5 @@
 @echo off
-cmake -S . -B VS2022_UWP -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0
+cmake -S . -B VS2022_UWP -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 %*
 echo If cmake failed then be sure to check the "Universal Windows Platform development" checkbox in the Visual Studio Installer
-echo Open VS2022_UWP\JoltPhysics.sln to build the project. 
+echo Open VS2022_UWP\JoltPhysics.sln to build the project.
 echo Note that none of the sample applications are available for the Universal Windows Platform (use cmake_vs2022_cl.bat instead).

+ 2 - 2
Build/cmake_vs2022_uwp_arm.bat

@@ -1,5 +1,5 @@
 @echo off
-cmake -S . -B VS2022_UWP_ARM -G "Visual Studio 17 2022" -A ARM64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0
+cmake -S . -B VS2022_UWP_ARM -G "Visual Studio 17 2022" -A ARM64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 %*
 echo If cmake failed then be sure to check the "Universal Windows Platform development" checkbox in the Visual Studio Installer
-echo Open VS2022_UWP_ARM\JoltPhysics.sln to build the project. 
+echo Open VS2022_UWP_ARM\JoltPhysics.sln to build the project.
 echo Note that none of the sample applications are available for the Universal Windows Platform (use cmake_vs2022_cl_arm.bat instead).

+ 1 - 1
Build/cmake_windows_mingw.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ -z $1 ] 
+if [ -z $1 ]
 then
 	BUILD_TYPE=Debug
 else