Browse Source

Update project build files

master
Jake Wakeling 2 years ago
parent
commit
f4859243c7
  1. 13
      .gitignore
  2. 10
      BuildUNIX.sh
  3. 6
      CMakeLists.txt
  4. 6
      README.md
  5. 4
      build/buildUNIX.sh

13
.gitignore vendored

@ -1,8 +1,5 @@
.clangd/
bin/
build/*
!build/buildUNIX.sh
!build/buildWIN32.bat
!build/buildWIN64.bat
compile_commands.json
lib/
/.clangd/
/bin/
/build/
/compile_commands.json
/lib/

10
BuildUNIX.sh

@ -0,0 +1,10 @@
#!/usr/bin/env sh
dir="$(dirname $(realpath "$0"))"
cmake -S "${dir}" -B "${dir}/build" \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
cmake --build "${dir}/build"
mv -f "${dir}/build/compile_commands.json" "${dir}/compile_commands.json"

6
CMakeLists.txt

@ -2,14 +2,10 @@
# CMakeLists file for OBFI
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
PROJECT(OBFI C)
PROJECT(OBFI VERSION 1.0.2 LANGUAGES C)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
ADD_COMPILE_DEFINITIONS(VERSION="1.0.2")
FILE(GLOB SOURCES ${CMAKE_SOURCE_DIR}/src/*)
ADD_EXECUTABLE(obfi ${SOURCES})

6
README.md

@ -25,12 +25,10 @@ Binaries will be located in the `bin` directory.
### UNIX Build
Run `buildUNIX.sh` in the `build` directory, or
Run `BuildUNIX.sh`, or
```sh
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make
cmake -S . -B build && cmake --build build
```
## Meta

4
build/buildUNIX.sh

@ -1,4 +0,0 @@
#!/usr/bin/env sh
dir="$(dirname $(realpath "$0"))" && cd "$dir"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ../ && make
mv -f "compile_commands.json" "../compile_commands.json"
Loading…
Cancel
Save