diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-11-21 00:08:12 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-11-21 01:00:50 -0500 |
commit | 6a0aa493a001df88c31dc41d3bd03b9433347235 (patch) | |
tree | 54ebb52effff630eb528582349880e7e8a8d9896 | |
parent | e3d36cb0249dcea99702db3694c0b1c2691d1ee2 (diff) | |
download | reloc-6a0aa493a001df88c31dc41d3bd03b9433347235.tar.gz |
GitHub Actions
* Add MSVC support
* Update README.md to reflect changes
* Implement ci.yml
* Add missing argument to usage statement
-rw-r--r-- | .github/workflows/ci.yml | 38 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | README.md | 19 | ||||
-rw-r--r-- | main.c | 2 |
4 files changed, 58 insertions, 3 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..be6a633 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: ci + +#on: [push, pull_request] +on: [push] + +jobs: + unix: + name: "${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [ubuntu-latest, macOS-latest] + + steps: + - uses: actions/checkout@v1 + - name: configure + run: cmake . + - name: make + run: make + - name: test + run: ctest -V + - name: install + run: sudo make install + + windows: + name: "${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [windows-latest] + steps: + - uses: actions/checkout@v1 + - name: configure + run: cmake . + - name: make + run: cmake --build . + - name: test + run: ctest -V diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d7c338..fef8144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.11) project(relocate C) set(VERSION "1.2.2") set(CMAKE_C_STANDARD 99) -if(CMAKE_CL_64) +if(MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /Wall") else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra") @@ -2,21 +2,38 @@ Replace strings in binary executables and data files. + + ## System Requirements * `gcc` +* _or_ `clang` +* _or_ Microsoft Visual Studio (`cl.exe`)p * `>=cmake-2.18.11` ## Installing +### Linux / MacOS + ```bash $ git clone https://github.com/jhunkeler/reloc $ mkdir build $ cd build -$ cmake -DCMAKE_INSTALL_PREFIX=/some/place .. +$ cmake -DCMAKE_INSTALL_PREFIX=/some/place -DCMAKE_BUILD_TYPE=Release .. $ make install ``` +### Windows + +```cmd +> git clone https://github.com/jhunkeler/reloc +> cd reloc +> mkdir build +> cd build +> cmake -DCMAKE_INSTALL_PREFIX=c:\some\place -DCMAKE_BUILD_TYPE=Release .. +> cmake --build . --target INSTALL +``` + ## Usage ``` $ reloc <str1> <str2> <input_file> <output_file> @@ -6,7 +6,7 @@ void show_version() { } void usage(char *program) { - printf("usage: %s [-V] <str1> <str2> <input_file> <output_file>\n" + printf("usage: %s [-hV] <str1> <str2> <input_file> <output_file>\n" "\n" "Options:\n" "--help (-h) - Display this help message\n" |