Browse Source

Tested compilation with CLANG on Linux.

David Piuva 1 year ago
parent
commit
96c0c93a2d

+ 3 - 0
Source/SDK/cube/Cube.DsrProj

@@ -5,6 +5,9 @@ Graphics
 Crawl "main.cpp"
 Crawl "main.cpp"
 Import "../../DFPSR/DFPSR.DsrHead"
 Import "../../DFPSR/DFPSR.DsrHead"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 3 - 0
Source/SDK/fileFinder/FileFinder.DsrProj

@@ -2,6 +2,9 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
 Crawl "main.cpp"
 Crawl "main.cpp"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 3 - 0
Source/SDK/guiExample/GuiExample.DsrProj

@@ -5,6 +5,9 @@ Graphics
 Crawl "main.cpp"
 Crawl "main.cpp"
 Import "../../DFPSR/DFPSR.DsrHead"
 Import "../../DFPSR/DFPSR.DsrHead"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 3 - 0
Source/SDK/integrationTest/IntegrationTest.DsrProj

@@ -5,6 +5,9 @@ Graphics
 Crawl "main.cpp"
 Crawl "main.cpp"
 Import "../../DFPSR/DFPSR.DsrHead"
 Import "../../DFPSR/DFPSR.DsrHead"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 3 - 0
Source/SDK/sandbox/Sandbox.DsrProj

@@ -3,6 +3,9 @@ ReuseMemory
 Graphics
 Graphics
 #Sound
 #Sound
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # An include using quotation marks will detect the header and its headers recursively.
 # An include using quotation marks will detect the header and its headers recursively.
 # For each detected header, the build system looks for an implementation file of the same name in the same folder.
 # For each detected header, the build system looks for an implementation file of the same name in the same folder.
 # Because sandbox.cpp and tool.cpp don't have sandbox.h/hpp or tool.h/hpp, the build system can't know that main depends on them.
 # Because sandbox.cpp and tool.cpp don't have sandbox.h/hpp or tool.h/hpp, the build system can't know that main depends on them.

+ 3 - 0
Source/SDK/terrain/Terrain.DsrProj

@@ -5,6 +5,9 @@ Graphics
 Crawl "main.cpp"
 Crawl "main.cpp"
 Import "../../DFPSR/DFPSR.DsrHead"
 Import "../../DFPSR/DFPSR.DsrHead"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 3 - 0
Source/templates/basic3D/Basic3D.DsrProj

@@ -5,6 +5,9 @@ Sound
 Crawl "main.cpp"
 Crawl "main.cpp"
 Import "../../DFPSR/DFPSR.DsrHead"
 Import "../../DFPSR/DFPSR.DsrHead"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 4 - 0
Source/templates/basicCLI/BasicCLI.DsrProj

@@ -1,5 +1,9 @@
 # No need to import DFPSR.DsrHead with stub backends when only including essential headers.
 # No need to import DFPSR.DsrHead with stub backends when only including essential headers.
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 Crawl "main.cpp"
 Crawl "main.cpp"
 
 
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.

+ 3 - 0
Source/templates/basicGUI/BasicGUI.DsrProj

@@ -5,6 +5,9 @@ Sound
 Crawl "main.cpp"
 Crawl "main.cpp"
 Import "../../DFPSR/DFPSR.DsrHead"
 Import "../../DFPSR/DFPSR.DsrHead"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime

+ 8 - 1
Source/tools/builder/buildProject.sh

@@ -1,7 +1,14 @@
 
 
 # Local build settings that should be configured before building for the first time.
 # Local build settings that should be configured before building for the first time.
 
 
+# Make sure to erase all objects in the temporary folder before changing compiler.
+
+# Compile using GCC's C++ compiler
 CPP_COMPILER_PATH="/usr/bin/g++"
 CPP_COMPILER_PATH="/usr/bin/g++"
+
+# Compile using CLANG (Needs a 'Link "stdc++"' command in each project)
+#CPP_COMPILER_PATH="/usr/bin/clang"
+
 echo "Change CPP_COMPILER_PATH in ${BUILDER_FOLDER}/buildProject.sh if you are not using ${CPP_COMPILER_PATH} as your compiler."
 echo "Change CPP_COMPILER_PATH in ${BUILDER_FOLDER}/buildProject.sh if you are not using ${CPP_COMPILER_PATH} as your compiler."
 
 
 # Change TEMPORARY_FOLDER if you don't want to recompile everything after each reboot, or your operating system has a different path to the temporary folder.
 # Change TEMPORARY_FOLDER if you don't want to recompile everything after each reboot, or your operating system has a different path to the temporary folder.
@@ -35,7 +42,7 @@ else
 	echo "Building the Builder build system for first time use."
 	echo "Building the Builder build system for first time use."
 	LIBRARY_PATH="$(realpath ${BUILDER_FOLDER}/../../DFPSR)"
 	LIBRARY_PATH="$(realpath ${BUILDER_FOLDER}/../../DFPSR)"
 	SOURCE_CODE="${BUILDER_FOLDER}/code/main.cpp ${BUILDER_FOLDER}/code/Machine.cpp ${BUILDER_FOLDER}/code/generator.cpp ${BUILDER_FOLDER}/code/analyzer.cpp ${BUILDER_FOLDER}/code/expression.cpp ${LIBRARY_PATH}/collection/collections.cpp ${LIBRARY_PATH}/api/fileAPI.cpp ${LIBRARY_PATH}/api/bufferAPI.cpp ${LIBRARY_PATH}/api/stringAPI.cpp ${LIBRARY_PATH}/api/timeAPI.cpp ${LIBRARY_PATH}/base/SafePointer.cpp"
 	SOURCE_CODE="${BUILDER_FOLDER}/code/main.cpp ${BUILDER_FOLDER}/code/Machine.cpp ${BUILDER_FOLDER}/code/generator.cpp ${BUILDER_FOLDER}/code/analyzer.cpp ${BUILDER_FOLDER}/code/expression.cpp ${LIBRARY_PATH}/collection/collections.cpp ${LIBRARY_PATH}/api/fileAPI.cpp ${LIBRARY_PATH}/api/bufferAPI.cpp ${LIBRARY_PATH}/api/stringAPI.cpp ${LIBRARY_PATH}/api/timeAPI.cpp ${LIBRARY_PATH}/base/SafePointer.cpp"
-	"${CPP_COMPILER_PATH}" -o "${BUILDER_EXECUTABLE}" ${SOURCE_CODE} -std=c++14
+	"${CPP_COMPILER_PATH}" -o "${BUILDER_EXECUTABLE}" ${SOURCE_CODE} -std=c++14 -lstdc++
 	if [ $? -eq 0 ]; then
 	if [ $? -eq 0 ]; then
 		echo "Completed building the Builder build system."
 		echo "Completed building the Builder build system."
 	else
 	else

+ 3 - 0
Source/tools/wizard/Wizard.DsrProj

@@ -18,6 +18,9 @@ Import "../../DFPSR/DFPSR.DsrHead"
 # The DFPSR library uses C++14 as a minimum requirement, but you can use newer versions as well.
 # The DFPSR library uses C++14 as a minimum requirement, but you can use newer versions as well.
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
 
 
+# If compiling using CLANG instead of GCC in tools/builder/buildProject.sh, you need to include the C++ standard library explicitly.
+#Link "stdc++"
+
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 # Linking statically to standard C/C++ libraries allow running the program without installing them.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 #   Recommended for making an installer for another application or programs that should not need an installer.
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime
 # If you don't want static linking of standard C/C++ libraries, you have to comment out StaticRuntime