From 78085c9b78df53c8d2cc2471af71c2ebcd02f817 Mon Sep 17 00:00:00 2001 From: wootguy Date: Tue, 23 Apr 2024 05:50:22 -0700 Subject: [PATCH] fix workflow builds --- .github/workflows/build.yml | 16 ++++------------ CMakeLists.txt | 11 ++++++----- README.md | 4 ++-- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61bc84a0..4612ba93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,19 +9,15 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + with: + submodules: 'true' - name: Download and install dependencies run: | - Invoke-WebRequest https://github.com/ocornut/imgui/archive/refs/tags/v1.81.zip -outfile v1.81.zip - Invoke-WebRequest https://github.com/glfw/glfw/releases/download/3.3.3/glfw-3.3.3.zip -outfile glfw-3.3.3.zip Invoke-WebRequest https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip -outfile glew-2.2.0-win32.zip - tar -xf v1.81.zip - tar -xf glfw-3.3.3.zip tar -xf glew-2.2.0-win32.zip - ren imgui-1.81 imgui - ren glfw-3.3.3 glfw ren glew-2.2.0 glew - name: Build release @@ -42,17 +38,13 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + with: + submodules: 'true' - name: Download and install dependencies run: | sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libglfw3-dev libglew-dev libxxf86vm-dev - wget https://github.com/ocornut/imgui/archive/refs/tags/v1.81.zip - - unzip -q v1.81.zip - - mv imgui-1.81 imgui - - name: Build release run: | mkdir build; cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index 99ac535c..cea7e9be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,13 +94,14 @@ target_link_libraries(${PROJECT_NAME} glfw) add_definitions(-DGLEW_STATIC) if(MSVC) + # no warnings for release builds + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0") + + # compile using the static runtime + set_property(TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + add_subdirectory(glfw) - # compile using the static runtime - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /W0") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /wd4244 /wd4018") - - # Disable C++ exceptions set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT bspguy) target_link_libraries(${PROJECT_NAME} opengl32 ${CMAKE_CURRENT_SOURCE_DIR}/glew/lib/Release/x64/glew32s.lib) diff --git a/README.md b/README.md index 1a154d4a..edd5d3b7 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Run 'bspguy help' to read about a specific command. * Visual Studio: Make sure to checkmark "Desktop development with C++" if you're installing for the first time. 1. Open a command prompt somewhere and run this command to download the source code (don't click the download zip button!): ``` - git clone --recurse-submodules https://github.com/wootguy/bspguy + git clone --recurse-submodules --shallow-submodules https://github.com/wootguy/bspguy ``` 1. Download [GLEW](http://glew.sourceforge.net/) (choose the `Binaries Windows 32-bit and 64-bit` link) and extract the `glew-x.y.z` folder into the `bspguy` folder that was created in the previous step. Rename the `glew-x.y.z` folder to `glew`. 1. Open a command prompt in the `bspguy` folder and run these commands: @@ -73,7 +73,7 @@ Run 'bspguy help' to read about a specific command. * Debian: `sudo apt install build-essential git cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev xorg-dev libglfw3-dev libglew-dev libxxf86vm-dev` 1. Open a terminal somewhere and run these commands: ``` - git clone --recurse-submodules https://github.com/wootguy/bspguy + git clone --recurse-submodules --shallow-submodules https://github.com/wootguy/bspguy cd bspguy mkdir build; cd build cmake .. -DCMAKE_BUILD_TYPE=RELEASE