Author | Jakob Wakeling <[email protected]> |
Date | 2020-08-14 08:25:52 |
Commit | fd85dcb59b7bede580449046b4c0d8c45000a8fc |
Parent | 22e8bce9a0b3cb9a1a48986931229811c808f974 |
Update project build files
Diffstat
M | .gitignore | | | 13 | +++++-------- |
A | BuildUNIX.sh | | | 10 | ++++++++++ |
M | CMakeLists.txt | | | 6 | +----- |
M | README.md | | | 6 | ++---- |
D | build/buildUNIX.sh | | | 4 | ---- |
5 files changed, 18 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore index 99dc2fa..e01f885 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/BuildUNIX.sh b/BuildUNIX.sh new file mode 100755 index 0000000..d59505f --- /dev/null +++ b/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" diff --git a/CMakeLists.txt b/CMakeLists.txt index e18fc46..d8756de 100644 --- a/CMakeLists.txt +++ b/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}) diff --git a/README.md b/README.md index e9554f5..fa44a13 100644 --- a/README.md +++ b/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 diff --git a/build/buildUNIX.sh b/build/buildUNIX.sh deleted file mode 100755 index 38dd3a2..0000000 --- a/build/buildUNIX.sh +++ /dev/null @@ -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"