Skip to content

Commit

Permalink
chore(*): update build settings
Browse files Browse the repository at this point in the history
update build settings
  • Loading branch information
leleact committed Sep 1, 2024
1 parent 2dec8b3 commit b673979
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ build/
compile_commands.json
.clangd/
.cache/
settings.json
settings.json
/.vs
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(WIN32)
# set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
set(CMAKE_CXX_FLAGS_RELEASE "/MT") # for static libs
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
endif(WIN32)

add_subdirectory(third_party/googletest)
add_subdirectory(third_party/sqlite3)
add_subdirectory(third_party/header_only)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cpp test
--------
[![Build Status](https://img.shields.io/github/workflow/status/leleact/cpptest/Test/master?style=for-the-badge)](https://github.com/leleact/cpptest)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/leleact/cpptest/test.yml?style=for-the-badge)](https://github.com/leleact/cpptest)
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/spdlog.h"
#include <add.hpp>
#include <iostream>
int main() {
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include(unittest)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
cpp_add_test(TEST_NAME template_arg_test SOURCE_FILE template_arg_test.cpp)
cpp_add_test(TEST_NAME sqlite3_test SOURCE_FILE sqlite3_test.cpp)
target_link_libraries(sqlite3_test sqlite3 dl sqlite3_header spdlog::spdlog_header_only)
target_link_libraries(sqlite3_test sqlite3 sqlite3_header spdlog::spdlog_header_only)
cpp_add_test(TEST_NAME spdlog_test SOURCE_FILE spdlog_test.cpp)
target_link_libraries(spdlog_test spdlog::spdlog_header_only)
cpp_add_test(TEST_NAME bitset_test SOURCE_FILE bitset_test.cpp)
Expand Down
4 changes: 3 additions & 1 deletion third_party/sqlite3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
add_library(sqlite3 src/sqlite3.c)
target_link_libraries(sqlite3 pthread dl)
if(UNIX)
target_link_libraries(sqlite3 pthread dl)
endif(UNIX)

add_executable(sqlite3-bin src/shell.c)
set_target_properties(sqlite3-bin PROPERTIES OUTPUT_NAME sqlite3)
Expand Down

0 comments on commit b673979

Please sign in to comment.