chore(run.sh): use out-of-tree build

This commit is contained in:
maelstrom 2025-03-12 02:11:44 +01:00
parent f81964e395
commit 7e6261fcf3
4 changed files with 8 additions and 15 deletions

17
.gitignore vendored
View file

@ -1,19 +1,14 @@
bin/
lib/
CMakeFiles/
cmake_install.cmake
CMakeCache.txt
Makefile
/bin/
/lib/
/build/
# Qt
.lupdate/
*.pro.user*
CMakeLists.txt.user*
*_autogen/
/*.pro.user*
/CMakeLists.txt.user*
# Clangd
/compile_commands.json
/.cache
# Gdb
.gdb_history
/.gdb_history

View file

@ -5,7 +5,7 @@ set(OpenGL_GL_PREFERENCE "GLVND")
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

View file

@ -15,8 +15,6 @@ find_package(glm CONFIG REQUIRED)
find_package(ReactPhysics3D REQUIRED)
find_package(pugixml REQUIRED)
file(MAKE_DIRECTORY bin)
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.h")
add_library(openblocks ${SOURCES})
set_target_properties(openblocks PROPERTIES OUTPUT_NAME "openblocks")

2
run.sh
View file

@ -6,4 +6,4 @@ if [ $# -eq 0 ] || ([ "$1" != "editor" ] && [ "$1" != "client" ]); then echo "Ar
[ "$3" = "-gdb" ] && PRE_COMMAND="gdb -ex run "
cmake $CMAKE_OPTS . && cmake --build . && $PRE_COMMAND ./bin/$1
cmake -Bbuild $CMAKE_OPTS . && (cd build; cmake --build .; cd ..) && $PRE_COMMAND ./build/bin/$1