From f36eb42df35e95cfd8a6bfd77c0a43ae3764ad6a Mon Sep 17 00:00:00 2001 From: Peter M. Groen Date: Thu, 21 Apr 2022 15:49:08 +0200 Subject: [PATCH] Add static build-switch --- CMakeLists.txt | 3 ++- src/CMakeLists.txt | 3 ++- submodules/cmake | 1 + tests/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 160000 submodules/cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e44054b..43c22bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,12 @@ cmake_minimum_required(VERSION 3.0) project(osdev_logger) LIST( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/submodules/cmake ) -LIST( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/submodules/versioning/cmake ) include(projectheader) project_header(osdev_logger) +set(BUILD_STATIC "ON") + add_subdirectory(src) add_subdirectory(tests) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5ea4c55..778769a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,13 +2,14 @@ cmake_minimum_required(VERSION 3.12) include(projectheader) project_header(logger) +set(BUILD_AS_STATIC "ON") + include_directories( SYSTEM ) include(compiler) set(SRC_LIST - #${CMAKE_CURRENT_SOURCE_DIR}/logger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/threadcontext.cpp ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp ) diff --git a/submodules/cmake b/submodules/cmake new file mode 160000 index 0000000..83d7bf3 --- /dev/null +++ b/submodules/cmake @@ -0,0 +1 @@ +Subproject commit 83d7bf32bbdfb50a077daaa1d4cc9d611570b93e diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index af991de..d93c3de 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) +LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/submodules/cmake) include(projectheader) project_header(test_logger) -- libgit2 0.21.4