Browse Source

meta: Restructure project

master
Jake Wakeling 2 years ago
parent
commit
bd9fc8b8e4
  1. 23
      CMakeLists.txt
  2. 2
      TestUNIX.sh
  3. 0
      src/crypt.h
  4. 0
      src/endian.h
  5. 0
      src/error.c
  6. 0
      src/error.h
  7. 0
      src/mode.c
  8. 0
      src/mode.h
  9. 0
      src/optget.c
  10. 0
      src/optget.h
  11. 2
      src/test/test_crypt.c
  12. 2
      src/test/test_endian.c
  13. 2
      src/test/test_error.c
  14. 2
      src/test/test_optget.c
  15. 0
      src/test/unit.h

23
CMakeLists.txt

@ -1,20 +1,23 @@
# CMakeLists.txt
# CMakeLists file for OMKOV lib
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
PROJECT(lib C)
PROJECT(lib VERSION 0.0.0 LANGUAGES C)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_STATIC_LIBRARY_PREFIX "")
FILE(GLOB LIBSRC ${PROJECT_SOURCE_DIR}/src/lib/*)
FILE(GLOB SOURCES ${PROJECT_SOURCE_DIR}/src/*)
ADD_LIBRARY(lib STATIC ${LIBSRC})
ADD_LIBRARY(lib STATIC ${SOURCES})
LINK_LIBRARIES(lib)
ADD_EXECUTABLE(test_crypt ${PROJECT_SOURCE_DIR}/src/test_crypt.c)
ADD_EXECUTABLE(test_endian ${PROJECT_SOURCE_DIR}/src/test_endian.c)
ADD_EXECUTABLE(test_error ${PROJECT_SOURCE_DIR}/src/test_error.c)
ADD_EXECUTABLE(test_optget ${PROJECT_SOURCE_DIR}/src/test_optget.c)
ADD_EXECUTABLE(test_crypt ${PROJECT_SOURCE_DIR}/src/test/test_crypt.c)
ADD_EXECUTABLE(test_endian ${PROJECT_SOURCE_DIR}/src/test/test_endian.c)
ADD_EXECUTABLE(test_error ${PROJECT_SOURCE_DIR}/src/test/test_error.c)
ADD_EXECUTABLE(test_optget ${PROJECT_SOURCE_DIR}/src/test/test_optget.c)
ENABLE_TESTING()
ADD_TEST(NAME test_crypt COMMAND test_crypt)
ADD_TEST(NAME test_endian COMMAND test_endian)
ADD_TEST(NAME test_error COMMAND test_error)
ADD_TEST(NAME test_optget COMMAND test_optget)

2
TestUNIX.sh

@ -0,0 +1,2 @@
#!/usr/bin/env sh
(cd "$(dirname $(realpath "$0"))/build"; ctest)

0
src/lib/crypt.h → src/crypt.h

0
src/lib/endian.h → src/endian.h

0
src/lib/error.c → src/error.c

0
src/lib/error.h → src/error.h

0
src/lib/mode.c → src/mode.c

0
src/lib/mode.h → src/mode.h

0
src/lib/optget.c → src/optget.c

0
src/lib/optget.h → src/optget.h

2
src/test_crypt.c → src/test/test_crypt.c

@ -17,7 +17,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
*/
#include "lib/crypt.h"
#include "../crypt.h"
#include "unit.h"
#include <stdint.h>

2
src/test_endian.c → src/test/test_endian.c

@ -17,7 +17,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
*/
#include "lib/endian.h"
#include "../endian.h"
#include "unit.h"
#include <stdint.h>

2
src/test_error.c → src/test/test_error.c

@ -3,7 +3,7 @@
// Copyright (C) 2020, Jakob Wakeling
// All rights reserved.
#include "lib/error.h"
#include "../error.h"
int main(int ac, char *av[]) { A0 = av[0];
warn("%s: %s", "warn", serr());

2
src/test_optget.c → src/test/test_optget.c

@ -3,7 +3,7 @@
// Copyright (C) 2020, Jakob Wakeling
// All rights reserved.
#include "lib/optget.h"
#include "../optget.h"
#include "unit.h"
#include <stdbool.h>

0
src/unit.h → src/test/unit.h

Loading…
Cancel
Save