summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD21
-rw-r--r--build-system.patch552
3 files changed, 582 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d6b63fe353b..83e16b5d004 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = bsf-git
pkgdesc = A C++ library that aims to provide a unified foundation for the development of real-time graphical applications, whether games, engines or tools
- pkgver = r4575.54f5a3abc
+ pkgver = r4583.852c0abe4
pkgrel = 1
url = https://www.bsframework.io/
arch = x86_64
@@ -9,6 +9,21 @@ pkgbase = bsf-git
makedepends = cmake
makedepends = doxygen
makedepends = ninja
+ source = git+https://github.com/GameFoundry/bsf.git
+ source = install-dir.patch
+ source = build-system.patch
+ source = https://data.banshee3d.com/bsfCompiledData_Master_5.zip
+ source = https://data.banshee3d.com/bsfData_Master_6.zip
+ source = https://data.banshee3d.com/bsfDependencies_Linux_Master_8.zip
+ sha256sums = SKIP
+ sha256sums = 3ebcebdbe4d5bad832a47109b09f6d9bcd3e02b7a0bb9be2301c8bd630ed706b
+ sha256sums = 1fda65aeb00578833a17a4347a6abb4062c44f48beccd3c83d762c29a9abb7b3
+ sha256sums = 49b419403f4f85e189832f3b89c78c037e7b531541bb67b130764f33c7306224
+ sha256sums = 3b5e087e200e786ab1a0b79d6f3cd04d4c70fde9337dc8082a13479f477d1025
+ sha256sums = 60c53790eda57495fefdad2bcc4a6a78198a330e70aeec71abc213edcc8b7036
+
+pkgname = bsf-git
+ arch = x86_64
depends = libutil-linux
depends = libx11
depends = icu
@@ -23,21 +38,8 @@ pkgbase = bsf-git
depends = freeimage
depends = freetype2
provides = bsf
- conflicts = bsf
- source = git+https://github.com/Meumeu/bsf.git#branch=build-system-cleanup
- source = install-dir.patch
- source = https://data.banshee3d.com/bsfCompiledData_Master_5.zip
- source = https://data.banshee3d.com/bsfData_Master_6.zip
- source = https://data.banshee3d.com/bsfDependencies_Linux_Master_8.zip
- sha256sums = SKIP
- sha256sums = 3ebcebdbe4d5bad832a47109b09f6d9bcd3e02b7a0bb9be2301c8bd630ed706b
- sha256sums = 49b419403f4f85e189832f3b89c78c037e7b531541bb67b130764f33c7306224
- sha256sums = 3b5e087e200e786ab1a0b79d6f3cd04d4c70fde9337dc8082a13479f477d1025
- sha256sums = 60c53790eda57495fefdad2bcc4a6a78198a330e70aeec71abc213edcc8b7036
-
-pkgname = bsf-git
+ replaces = bsf
pkgname = bsf-git-docs
arch = any
- depends =
diff --git a/PKGBUILD b/PKGBUILD
index a61e019913c..77f13c833b7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=(bsf-git bsf-git-docs)
pkgbase=bsf-git
_pkgname=bsf
-pkgver=r4575.54f5a3abc
+pkgver=r4583.852c0abe4
pkgrel=1
epoch=
pkgdesc="A C++ library that aims to provide a unified foundation for the development of real-time graphical applications, whether games, engines or tools"
@@ -10,27 +10,25 @@ arch=(x86_64)
url="https://www.bsframework.io/"
license=('MIT')
groups=()
-depends=(libutil-linux libx11 icu libxcursor libxrandr libxi libgl openal flac libvorbis snappy freeimage freetype2)
makedepends=(git cmake doxygen ninja)
checkdepends=()
optdepends=()
-provides=(bsf)
-conflicts=(bsf)
-replaces=()
+conflicts=()
backup=()
options=()
install=
changelog=
-# source=("git+https://github.com/GameFoundry/bsf.git"
-source=("git+https://github.com/Meumeu/bsf.git#branch=build-system-cleanup"
+source=("git+https://github.com/GameFoundry/bsf.git"
"install-dir.patch"
+ "build-system.patch"
"https://data.banshee3d.com/bsfCompiledData_Master_5.zip"
"https://data.banshee3d.com/bsfData_Master_6.zip"
"https://data.banshee3d.com/bsfDependencies_Linux_Master_8.zip")
noextract=()
sha256sums=('SKIP'
'3ebcebdbe4d5bad832a47109b09f6d9bcd3e02b7a0bb9be2301c8bd630ed706b'
+ '1fda65aeb00578833a17a4347a6abb4062c44f48beccd3c83d762c29a9abb7b3'
'49b419403f4f85e189832f3b89c78c037e7b531541bb67b130764f33c7306224'
'3b5e087e200e786ab1a0b79d6f3cd04d4c70fde9337dc8082a13479f477d1025'
'60c53790eda57495fefdad2bcc4a6a78198a330e70aeec71abc213edcc8b7036')
@@ -49,6 +47,7 @@ prepare() {
rm -rf "$_pkgname"/Dependencies/freetype
rm -rf "$_pkgname"/Dependencies/freeimg
+ patch -d bsf -p1 < build-system.patch
patch -d bsf -p1 < install-dir.patch
}
@@ -63,6 +62,8 @@ pkgver() {
}
build() {
+
+
mkdir -p "$_pkgname"/build
cd "$_pkgname"/build
@@ -74,6 +75,11 @@ build() {
}
package_bsf-git() {
+ provides=(bsf)
+ replaces=(bsf)
+ depends=(libutil-linux libx11 icu libxcursor libxrandr libxi libgl openal flac libvorbis snappy freeimage freetype2)
+ arch=(x86_64)
+
pushd "$_pkgname"/build
DESTDIR="$pkgdir"/ ninja install
popd > /dev/null
@@ -85,7 +91,6 @@ package_bsf-git() {
}
package_bsf-git-docs() {
- depends=()
arch=(any)
mkdir -p "$pkgdir"/usr/share/doc/$pkgbase
diff --git a/build-system.patch b/build-system.patch
new file mode 100644
index 00000000000..fec2ec0b397
--- /dev/null
+++ b/build-system.patch
@@ -0,0 +1,552 @@
+diff --git a/Source/CMake/HelperMethods.cmake b/Source/CMake/HelperMethods.cmake
+index 49adb3c50..f7f496188 100644
+--- a/Source/CMake/HelperMethods.cmake
++++ b/Source/CMake/HelperMethods.cmake
+@@ -205,7 +205,7 @@ MACRO(install_dependency_binaries FOLDER_NAME)
+ set(DEBUG_FILENAME ${DEBUG_FILENAME}.so)
+ set(SRC_RELEASE ${${LOOP_ENTRY}_LIBRARY_RELEASE})
+ set(SRC_DEBUG ${${LOOP_ENTRY}_LIBRARY_DEBUG})
+- set(DESTINATION_DIR lib)
++ set(DESTINATION_DIR lib/bsf-${BS_FRAMEWORK_VERSION_MAJOR}.${BS_FRAMEWORK_VERSION_MINOR}.${BS_FRAMEWORK_VERSION_PATCH})
+ endif()
+
+ install(
+@@ -335,6 +335,7 @@ function(install_bsf_target targetName)
+
+ install(
+ TARGETS ${targetName}
++ EXPORT bsf
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+@@ -380,6 +381,92 @@ function(copyBsfBinaries target srcDir)
+ endif()
+ endfunction()
+
++function(add_common_flags target)
++ get_target_property(target_type ${target} TYPE)
++
++ if(MSVC)
++ # Linker
++ # The VS generator seems picky about how the linker flags are passed: we have to make sure
++ # the options are quoted correctly and with append_string or random semicolons will be
++ # inserted in the command line; and unrecognised options are only treated as warnings
++ # and not errors so they won't be caught by CI. Make sure the options are separated by
++ # spaces too.
++ # For some reason this does not apply to the compiler options...
++
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "/DYNAMICBASE /NOLOGO")
++
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG "/DEBUG")
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO "/DEBUG /LTCG:incremental /INCREMENTAL:NO /OPT:REF")
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL "/DEBUG /LTCG /INCREMENTAL:NO /OPT:REF")
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE "/DEBUG /LTCG /INCREMENTAL:NO /OPT:REF")
++
++ if(BS_64BIT)
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /OPT:ICF")
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /OPT:ICF")
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /OPT:ICF")
++ endif()
++
++ if (${target_type} STREQUAL "SHARED_LIBRARY" OR ${target_type} STREQUAL "MODULE_LIBRARY")
++ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " /DLL")
++ endif()
++
++ # Compiler
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS /GS- /W3 /WX- /MP /nologo /bigobj /wd4577 /wd4530)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -DWIN32 -D_WINDOWS)
++
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Debug>:/Od /RTC1 /MDd -DDEBUG>)
++
++ if(BS_64BIT) # Debug edit and continue for 64-bit
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Debug>:/ZI>)
++ else() # Normal debug for 32-bit
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Debug>:/Zi>)
++ endif()
++
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:RelWithDebInfo>:/GL /Gy /Zi /O2 /Oi /MD -DDEBUG>)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:MinSizeRel>:/GL /Gy /Zi /O2 /Oi /MD -DNDEBUG>)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Release>:/GL /Gy /Zi /O2 /Oi /MD -DNDEBUG>)
++
++ # Global defines
++ #add_definitions(-D_HAS_EXCEPTIONS=0)
++
++ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
++ # Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
++ # TODO: Use link-time optimization -flto. Might require non-default linker.
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1)
++
++ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -fno-ms-compatibility)
++
++ if(APPLE)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -fobjc-arc $<$<COMPILE_LANGUAGE:CXX>:-std=c++1z>)
++ endif()
++ endif()
++
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Debug>:-ggdb -O0 -DDEBUG>)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:RelWithDebInfo>:-ggdb -O2 -DDEBUG -Wno-unused-variable>)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:MinSizeRel>:-ggdb -O2 -DNDEBUG -Wno-unused-variable>)
++ set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Release>:-ggdb -O2 -DNDEBUG -Wno-unused-variable>)
++
++ if (${target_type} STREQUAL "EXECUTABLE")
++ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
++ set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS_DEBUG -no-pie)
++ set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS_RELWITHDEBINFO -no-pie)
++ set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS_MINSIZEREL -no-pie)
++ set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS_RELEASE -no-pie)
++ endif()
++ endif()
++ else()
++ # TODO_OTHER_COMPILERS_GO_HERE
++ endif()
++
++ if (${target_type} STREQUAL "SHARED_LIBRARY")
++ set_property(TARGET ${target} PROPERTY VERSION ${BS_FRAMEWORK_VERSION_MAJOR}.${BS_FRAMEWORK_VERSION_MINOR}.${BS_FRAMEWORK_VERSION_PATCH})
++ set_property(TARGET ${target} PROPERTY SOVERSION ${BS_FRAMEWORK_VERSION_MAJOR})
++ endif()
++
++ set_property(TARGET ${target} PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/bsf-${BS_FRAMEWORK_VERSION_MAJOR}.${BS_FRAMEWORK_VERSION_MINOR}.${BS_FRAMEWORK_VERSION_PATCH})
++endfunction()
++
+ #######################################################################################
+ ##################### Built-in asset import and versioning ############################
+ #######################################################################################
+@@ -631,4 +718,4 @@ macro(conditional_cotire)
+ if(COMMAND cotire)
+ cotire(${ARGN})
+ endif()
+-endmacro()
+\ No newline at end of file
++endmacro()
+diff --git a/Source/CMake/Properties.cmake b/Source/CMake/Properties.cmake
+index 903dc13ac..eb6cf61a6 100644
+--- a/Source/CMake/Properties.cmake
++++ b/Source/CMake/Properties.cmake
+@@ -31,95 +31,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+
+ set(CMAKE_INSTALL_RPATH "\$ORIGIN")
+
+-## Compiler-specific settings
+-if(MSVC)
+- # Linker
+- set(BS_LINKER_FLAGS_COMMON "/DYNAMICBASE /NOLOGO")
+-
+- set(BS_LINKER_FLAGS_DEBUG "${BS_LINKER_FLAGS_COMMON} /DEBUG")
+- set(BS_LINKER_FLAGS_RELWITHDEBINFO "${BS_LINKER_FLAGS_COMMON} /LTCG:incremental /INCREMENTAL:NO /OPT:REF /DEBUG")
+- set(BS_LINKER_FLAGS_MINSIZEREL "${BS_LINKER_FLAGS_COMMON} /DEBUG /LTCG /INCREMENTAL:NO /OPT:REF")
+- set(BS_LINKER_FLAGS_RELEASE "${BS_LINKER_FLAGS_COMMON} /DEBUG /LTCG /INCREMENTAL:NO /OPT:REF")
+-
+- if(BS_64BIT)
+- set(BS_LINKER_FLAGS_RELWITHDEBINFO "${BS_LINKER_FLAGS_RELWITHDEBINFO} /OPT:ICF")
+- set(BS_LINKER_FLAGS_MINSIZEREL "${BS_LINKER_FLAGS_MINSIZEREL} /OPT:ICF")
+- set(BS_LINKER_FLAGS_RELEASE "${BS_LINKER_FLAGS_RELEASE} /OPT:ICF")
+- endif()
+-
+- set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DLL ${BS_LINKER_FLAGS_DEBUG}")
+- set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} /DLL ${BS_LINKER_FLAGS_DEBUG}")
+- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${BS_LINKER_FLAGS_DEBUG}")
+-
+- set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DLL ${BS_LINKER_FLAGS_RELWITHDEBINFO}")
+- set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} /DLL ${BS_LINKER_FLAGS_RELWITHDEBINFO}")
+- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} ${BS_LINKER_FLAGS_RELWITHDEBINFO}")
+-
+- set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /DLL ${BS_LINKER_FLAGS_MINSIZEREL}")
+- set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL} /DLL ${BS_LINKER_FLAGS_MINSIZEREL}")
+- set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} ${BS_LINKER_FLAGS_MINSIZEREL}")
+-
+- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DLL ${BS_LINKER_FLAGS_RELEASE}")
+- set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /DLL ${BS_LINKER_FLAGS_RELEASE}")
+- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${BS_LINKER_FLAGS_RELEASE}")
+-
+- # Compiler
+- set(BS_COMPILER_FLAGS_COMMON "/GS- /W3 /GR- /WX- /MP /nologo /bigobj /wd\"4577\" /wd\"4530\"")
+- set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS")
+-
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${BS_COMPILER_FLAGS_COMMON} /Od /RTC1 /MDd -DDEBUG")
+-
+- if(BS_64BIT) # Debug edit and continue for 64-bit
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
+- else() # Normal debug for 32-bit
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi")
+- endif()
+-
+- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${BS_COMPILER_FLAGS_COMMON} /GL /Gy /Zi /O2 /Oi /MD -DDEBUG")
+- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${BS_COMPILER_FLAGS_COMMON} /GL /Gy /Zi /O2 /Oi /MD -DNDEBUG")
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${BS_COMPILER_FLAGS_COMMON} /GL /Gy /Zi /O2 /Oi /MD -DNDEBUG")
+-
+- # Global defines
+- #add_definitions(-D_HAS_EXCEPTIONS=0)
+-
+-elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
+- # Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
+- # TODO: Use link-time optimization -flto. Might require non-default linker.
+- set(BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-ms-compatibility -msse4.1")
+-
+- if(APPLE)
+- set(BS_COMPILER_FLAGS_COMMON "${BS_COMPILER_FLAGS_COMMON} -fobjc-arc -std=c++1z")
+- endif()
+-
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O0 -DDEBUG")
+- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DDEBUG -Wno-unused-variable")
+- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DNDEBUG -Wno-unused-variable")
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DNDEBUG -Wno-unused-variable")
+-
+- if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -no-pie")
+- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -no-pie")
+- set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -no-pie")
+- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -no-pie")
+- endif()
+-
+-elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+- # TODO: Use link-time optimization -flto. Might require non-default linker.
+- set(BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti -msse4.1")
+-
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O0 -DDEBUG")
+- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DDEBUG -Wno-unused-variable")
+- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DNDEBUG -Wno-unused-variable")
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DNDEBUG -Wno-unused-variable")
+-
+- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -no-pie")
+- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -no-pie")
+- set(CMAKE_EXE_LINKER_FLAGS_MINSIZEDEL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEDEL} -no-pie")
+- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -no-pie")
+-else()
+-# TODO_OTHER_COMPILERS_GO_HERE
+-endif()
+-
+ # Enable colored output
+ if (CMAKE_GENERATOR STREQUAL "Ninja")
+ check_cxx_compiler_flag("-fdiagnostics-color=always" F_DIAGNOSTIC_COLOR_ALWAYS)
+@@ -138,8 +49,8 @@ else()
+ set(BS_OUTPUT_DIR_PREFIX x86)
+ endif()
+
+-set(BS_BINARY_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/bin/${BS_OUTPUT_DIR_PREFIX})
+-set(BS_LIBRARY_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/lib/${BS_OUTPUT_DIR_PREFIX})
++set(BS_BINARY_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin/${BS_OUTPUT_DIR_PREFIX})
++set(BS_LIBRARY_OUTPUT_DIR ${PROJECT_BINARY_DIR}/lib/${BS_OUTPUT_DIR_PREFIX})
+
+ if (BS_TOP_LEVEL)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BS_BINARY_OUTPUT_DIR}/Debug)
+diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
+index d8526f5ec..02ba71c5a 100644
+--- a/Source/CMakeLists.txt
++++ b/Source/CMakeLists.txt
+@@ -93,14 +93,21 @@ endif()
+ set(RENDERER_MODULE_LIB bsfRenderBeast)
+ set(PHYSICS_MODULE_LIB bsfPhysX)
+
+-## Generate config files)
+-configure_file("${BSF_SOURCE_DIR}/CMake/BsEngineConfig.h.in" "${BSF_SOURCE_DIR}/Foundation/bsfEngine/BsEngineConfig.h")
+-configure_file("${BSF_SOURCE_DIR}/CMake/BsFrameworkConfig.h.in" "${BSF_SOURCE_DIR}/Foundation/bsfUtility/BsFrameworkConfig.h")
++## Generate config files
++configure_file("${BSF_SOURCE_DIR}/CMake/BsEngineConfig.h.in" "${PROJECT_BINARY_DIR}/Generated/bsfEngine/BsEngineConfig.h")
++configure_file("${BSF_SOURCE_DIR}/CMake/BsFrameworkConfig.h.in" "${PROJECT_BINARY_DIR}/Generated/bsfUtility/BsFrameworkConfig.h")
+
+ # Set files disallowed in precompiled headers
+ set_directory_properties(PROPERTIES
+ COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
+
++# Remove /EHsc from CMAKE_CXX_FLAGS for MSVC to disable exceptions
++if (MSVC)
++ if(CMAKE_CXX_FLAGS MATCHES "/EHsc")
++ string(REPLACE "/EHsc" "/EHs-c-" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++ endif()
++endif()
++
+ # Sub-directories
+ ## Foundation
+ add_subdirectory(Foundation)
+@@ -165,6 +172,7 @@ endif()
+ ## Builtin resource preprocessing
+ add_executable(bsfImportTool
+ Foundation/bsfEngine/Resources/BsBuiltinResourcesImporter.cpp)
++add_common_flags(bsfImportTool)
+
+ target_link_libraries(bsfImportTool bsf)
+
+@@ -188,4 +196,6 @@ install(
+ DIRECTORY ../Data
+ DESTINATION bin/
+ PATTERN "../Data/Raw" EXCLUDE
++ PATTERN ".version" EXCLUDE
++ PATTERN ".reqversion" EXCLUDE
+ )
+diff --git a/Source/Foundation/CMakeLists.txt b/Source/Foundation/CMakeLists.txt
+index 3f833a937..ae2168edb 100644
+--- a/Source/Foundation/CMakeLists.txt
++++ b/Source/Foundation/CMakeLists.txt
+@@ -29,13 +29,25 @@ endif()
+
+ # Third party (non-package) libraries
+ add_library(ThirdParty INTERFACE)
+-target_include_directories(ThirdParty INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/bsfUtility/ThirdParty")
++target_include_directories(ThirdParty INTERFACE
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bsfUtility/ThirdParty>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/bsfUtility/ThirdParty>)
+
+ # Target
+ add_library(bsf SHARED ${BS_UTILITY_SRC} ${BS_CORE_SRC} ${BS_ENGINE_SRC})
+
++add_common_flags(bsf)
++
+ # Includes
+-target_include_directories(bsf PUBLIC "bsfUtility" "bsfCore" "bsfEngine")
++target_include_directories(bsf PUBLIC
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bsfUtility>
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bsfCore>
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bsfEngine>
++ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/Generated/bsfUtility>
++ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/Generated/bsfEngine>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/bsfUtility>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/bsfCore>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/bsfEngine>)
+
+ # Defines
+ target_compile_definitions(bsf PRIVATE
+@@ -47,6 +59,21 @@ target_compile_definitions(bsf PRIVATE
+ $<$<CONFIG:MinSizeRel>:BS_CONFIG=BS_CONFIG_MINSIZEREL>
+ $<$<CONFIG:Release>:BS_CONFIG=BS_CONFIG_RELEASE>)
+
++if(MSVC)
++ target_compile_options(bsf PUBLIC
++ $<$<COMPILE_LANGUAGE:CXX>:/GR->)
++elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
++ target_compile_options(bsf PUBLIC
++ -fno-exceptions
++ $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>)
++elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
++ target_compile_options(bsf PUBLIC
++ -fno-exceptions
++ $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>)
++else()
++# TODO_OTHER_COMPILERS_GO_HERE
++endif()
++
+ # Libraries
+ ## External lib: NVTT
+ target_link_libraries(bsf PRIVATE ${nvtt_LIBRARIES})
+@@ -113,8 +140,33 @@ install(
+ PATTERN "Private" EXCLUDE
+ )
+
++install(
++ DIRECTORY ${PROJECT_BINARY_DIR}/Generated/bsfEngine
++ DESTINATION include
++ FILES_MATCHING
++ PATTERN "*.h"
++)
++
++install(
++ DIRECTORY ${PROJECT_BINARY_DIR}/Generated/bsfUtility
++ DESTINATION include
++ FILES_MATCHING
++ PATTERN "*.h"
++)
++
+ install_bsf_target(bsf)
+
++# This doesn't actually install anything as it is an imported library
++# but it is required because it is a dependency of the bsf target
++install(TARGETS ThirdParty EXPORT bsf)
++
++install(
++ EXPORT bsf
++ NAMESPACE bsf::
++ FILE bsf-config.cmake
++ DESTINATION lib/bsf
++)
++
+ # Precompiled headers (Cotire)
+ if(MSVC)
+ find_windows_system_headers(windows_headers "Windows.h")
+@@ -128,4 +180,4 @@ endif()
+ set_directory_properties(PROPERTIES
+ COTIRE_PREFIX_HEADER_IGNORE_PATH "${ignore_paths}")
+
+-conditional_cotire(bsf)
+\ No newline at end of file
++conditional_cotire(bsf)
+diff --git a/Source/Foundation/bsfUtility/Prerequisites/BsPrerequisitesUtil.h b/Source/Foundation/bsfUtility/Prerequisites/BsPrerequisitesUtil.h
+index 884fd59ee..5239c0089 100644
+--- a/Source/Foundation/bsfUtility/Prerequisites/BsPrerequisitesUtil.h
++++ b/Source/Foundation/bsfUtility/Prerequisites/BsPrerequisitesUtil.h
+@@ -140,7 +140,7 @@
+ #define BS_PROFILING_ENABLED 1
+
+ // Config from the build system
+-#include "BsFrameworkConfig.h"
++#include <BsFrameworkConfig.h>
+
+ // Platform-specific stuff
+ #include "Prerequisites/BsPlatformDefines.h"
+diff --git a/Source/Plugins/bsfD3D11RenderAPI/CMakeLists.txt b/Source/Plugins/bsfD3D11RenderAPI/CMakeLists.txt
+index cfbb9ece0..6bcadeca6 100644
+--- a/Source/Plugins/bsfD3D11RenderAPI/CMakeLists.txt
++++ b/Source/Plugins/bsfD3D11RenderAPI/CMakeLists.txt
+@@ -4,6 +4,9 @@ include(CMakeSources.cmake)
+ # Target
+ add_library(bsfD3D11RenderAPI SHARED ${BS_D3D11RENDERAPI_SRC})
+
++# Common flags
++add_common_flags(bsfD3D11RenderAPI)
++
+ # Defines
+ target_compile_definitions(bsfD3D11RenderAPI PRIVATE -DBS_RSD3D11_EXPORTS)
+
+diff --git a/Source/Plugins/bsfFBXImporter/CMakeLists.txt b/Source/Plugins/bsfFBXImporter/CMakeLists.txt
+index 3f0cb6440..61b77406d 100644
+--- a/Source/Plugins/bsfFBXImporter/CMakeLists.txt
++++ b/Source/Plugins/bsfFBXImporter/CMakeLists.txt
+@@ -7,6 +7,9 @@ find_package(FBXSDK REQUIRED)
+ # Target
+ add_library(bsfFBXImporter SHARED ${BS_FBXIMPORTER_SRC})
+
++# Common flags
++add_common_flags(bsfFBXImporter)
++
+ # Includes
+ target_include_directories(bsfFBXImporter PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfFMOD/CMakeLists.txt b/Source/Plugins/bsfFMOD/CMakeLists.txt
+index cfca3fcf1..b7c5e5add 100644
+--- a/Source/Plugins/bsfFMOD/CMakeLists.txt
++++ b/Source/Plugins/bsfFMOD/CMakeLists.txt
+@@ -11,6 +11,9 @@ endif()
+ # Target
+ add_library(bsfFMOD SHARED ${BS_FMOD_SRC})
+
++# Common flags
++add_common_flags(bsfFMOD)
++
+ # Includes
+ target_include_directories(bsfFMOD PRIVATE
+ "./"
+diff --git a/Source/Plugins/bsfFontImporter/CMakeLists.txt b/Source/Plugins/bsfFontImporter/CMakeLists.txt
+index fcd4b640a..99d397bae 100644
+--- a/Source/Plugins/bsfFontImporter/CMakeLists.txt
++++ b/Source/Plugins/bsfFontImporter/CMakeLists.txt
+@@ -7,6 +7,9 @@ find_package(freetype REQUIRED)
+ # Target
+ add_library(bsfFontImporter SHARED ${BS_FONTIMPORTER_SRC})
+
++# Common flags
++add_common_flags(bsfFontImporter)
++
+ # Includes
+ target_include_directories(bsfFontImporter PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfFreeImgImporter/CMakeLists.txt b/Source/Plugins/bsfFreeImgImporter/CMakeLists.txt
+index c9f977aca..2ded00f26 100644
+--- a/Source/Plugins/bsfFreeImgImporter/CMakeLists.txt
++++ b/Source/Plugins/bsfFreeImgImporter/CMakeLists.txt
+@@ -7,6 +7,9 @@ find_package(freeimg REQUIRED)
+ # Target
+ add_library(bsfFreeImgImporter SHARED ${BS_FREEIMGIMPORTER_SRC})
+
++# Common flags
++add_common_flags(bsfFreeImgImporter)
++
+ # Includes
+ target_include_directories(bsfFreeImgImporter PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfGLRenderAPI/CMakeLists.txt b/Source/Plugins/bsfGLRenderAPI/CMakeLists.txt
+index e26157634..cdea749ca 100644
+--- a/Source/Plugins/bsfGLRenderAPI/CMakeLists.txt
++++ b/Source/Plugins/bsfGLRenderAPI/CMakeLists.txt
+@@ -10,6 +10,9 @@ endif()
+ # Target
+ add_library(bsfGLRenderAPI SHARED ${BS_GLRENDERAPI_SRC})
+
++# Common flags
++add_common_flags(bsfGLRenderAPI)
++
+ # Includes
+ target_include_directories(bsfGLRenderAPI PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfMono/CMakeLists.txt b/Source/Plugins/bsfMono/CMakeLists.txt
+index 9004720f5..4347025c9 100644
+--- a/Source/Plugins/bsfMono/CMakeLists.txt
++++ b/Source/Plugins/bsfMono/CMakeLists.txt
+@@ -7,6 +7,9 @@ find_package(mono)
+ # Target
+ add_library(bsfMono SHARED ${BS_MONO_SRC})
+
++# Common flags
++add_common_flags(bsfMono)
++
+ # Includes
+ target_include_directories(bsfMono PUBLIC "./")
+
+diff --git a/Source/Plugins/bsfOpenAudio/CMakeLists.txt b/Source/Plugins/bsfOpenAudio/CMakeLists.txt
+index 5968fff4f..947e68f50 100644
+--- a/Source/Plugins/bsfOpenAudio/CMakeLists.txt
++++ b/Source/Plugins/bsfOpenAudio/CMakeLists.txt
+@@ -12,6 +12,9 @@ endif()
+ # Target
+ add_library(bsfOpenAudio SHARED ${BS_OPENAUDIO_SRC})
+
++# Common flags
++add_common_flags(bsfOpenAudio)
++
+ # Includes
+ target_include_directories(bsfOpenAudio PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfPhysX/CMakeLists.txt b/Source/Plugins/bsfPhysX/CMakeLists.txt
+index 9bf280284..d0e71b487 100644
+--- a/Source/Plugins/bsfPhysX/CMakeLists.txt
++++ b/Source/Plugins/bsfPhysX/CMakeLists.txt
+@@ -7,6 +7,9 @@ find_package(PhysX REQUIRED)
+ # Target
+ add_library(bsfPhysX SHARED ${BS_PHYSX_SRC})
+
++# Common flags
++add_common_flags(bsfPhysX)
++
+ # Includes
+ target_include_directories(bsfPhysX PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfRenderBeast/CMakeLists.txt b/Source/Plugins/bsfRenderBeast/CMakeLists.txt
+index 877c9b95e..795d62fcd 100644
+--- a/Source/Plugins/bsfRenderBeast/CMakeLists.txt
++++ b/Source/Plugins/bsfRenderBeast/CMakeLists.txt
+@@ -4,6 +4,9 @@ include(CMakeSources.cmake)
+ # Target
+ add_library(bsfRenderBeast SHARED ${BS_RENDERBEAST_SRC})
+
++# Common flags
++add_common_flags(bsfRenderBeast)
++
+ # Includes
+ target_include_directories(bsfRenderBeast PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfSL/CMakeLists.txt b/Source/Plugins/bsfSL/CMakeLists.txt
+index 9ff374a19..e4a0e9fd9 100644
+--- a/Source/Plugins/bsfSL/CMakeLists.txt
++++ b/Source/Plugins/bsfSL/CMakeLists.txt
+@@ -30,6 +30,9 @@ find_package(XShaderCompiler)
+ # Target
+ add_library(bsfSL SHARED ${BS_SL_SRC})
+
++# Common flags
++add_common_flags(bsfSL)
++
+ # Includes
+ target_include_directories(bsfSL PRIVATE "./")
+
+diff --git a/Source/Plugins/bsfVulkanRenderAPI/CMakeLists.txt b/Source/Plugins/bsfVulkanRenderAPI/CMakeLists.txt
+index d2c85ea22..9fc7d86d2 100644
+--- a/Source/Plugins/bsfVulkanRenderAPI/CMakeLists.txt
++++ b/Source/Plugins/bsfVulkanRenderAPI/CMakeLists.txt
+@@ -10,6 +10,9 @@ endif()
+ # Target
+ add_library(bsfVulkanRenderAPI SHARED ${BS_VULKANRENDERAPI_SRC})
+
++# Common flags
++add_common_flags(bsfD3D11RenderAPI)
++
+ # Includes
+ target_include_directories(bsfVulkanRenderAPI PRIVATE "./")
+