Start to get CMake working
This commit is contained in:
parent
7c27b93098
commit
01f78487d9
25
CMakeLists.txt
Normal file
25
CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(open-source-search-engine)
|
||||
|
||||
file(GLOB SRC_FILES "src/*.cpp" "src/*.c" "src/*.h")
|
||||
list(REMOVE_ITEM SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
|
||||
add_compile_definitions(-DPTHREADS -D_REENTRANT_ -D_CHECK_FORMAT_STRING_)
|
||||
add_compile_options(-Wall -Wno-write-strings -Wstrict-aliasing=0 -Wno-uninitialized -Wno-unused-but-set-variable)
|
||||
#add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(Iconv REQUIRED)
|
||||
|
||||
add_library(osse STATIC ${SRC_FILES})
|
||||
target_link_libraries(osse PUBLIC OpenSSL::SSL ZLIB::ZLIB Iconv::Iconv)
|
||||
|
||||
add_executable(gb src/main.cpp)
|
||||
target_link_libraries(gb osse)
|
||||
|
||||
include(CTest)
|
||||
add_subdirectory(test)
|
@ -585,7 +585,7 @@ bool LangList::tldInit() {
|
||||
}
|
||||
|
||||
uint8_t LangList::catIdToLang(uint32_t catid) {
|
||||
register uint32_t i;
|
||||
uint32_t i;
|
||||
for(i = 0; i < sizeof(s_langToCatId)/sizeof(uint32_t); i++) {
|
||||
if(catid == (uint32_t)s_langToCatId[i]) return((uint8_t)i);
|
||||
}
|
||||
|
7
test/CMakeLists.txt
Normal file
7
test/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
find_package(Catch2 3 REQUIRED)
|
||||
|
||||
add_executable(Abbreviations src/Abbreviations.cpp)
|
||||
target_link_libraries(Abbreviations PRIVATE Catch2::Catch2)
|
||||
|
||||
include(Catch)
|
||||
catch_discover_tests(Abbreviations)
|
Loading…
x
Reference in New Issue
Block a user