Skip to content

Commit

Permalink
optimize build time (#523)
Browse files Browse the repository at this point in the history
* remove bio helper

* remove json helper

* remove weather helper

* refactor code

* remove dead includes

* remove doxyfile html

* add docs extra stylesheet

* add missing date header
  • Loading branch information
cieslarmichal authored Apr 4, 2024
1 parent dea3dc1 commit ee834b6
Show file tree
Hide file tree
Showing 138 changed files with 6,306 additions and 8,379 deletions.
241 changes: 0 additions & 241 deletions .cmake-format

This file was deleted.

37 changes: 17 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(BUILD_FAKER_TESTS DEFAULT ON)

if(MSVC)
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20 /permissive- /bigobj")
else()
else ()
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wconversion -Wformat -Werror"
)
endif()
endif ()

set(LIBRARY_NAME faker-cxx)

Expand All @@ -38,7 +38,6 @@ set(FAKER_SOURCES
src/modules/string/String.cpp
src/modules/word/Word.cpp
src/modules/phone/Phone.cpp
src/common/BioHelper.cpp
src/common/StringHelper.cpp
src/common/FormatHelper.cpp
src/common/LuhnCheck.cpp
Expand All @@ -53,15 +52,14 @@ set(FAKER_SOURCES
src/modules/videoGame/VideoGame.cpp
src/modules/medicine/Medicine.cpp
src/modules/weather/Weather.cpp
src/common/WeatherHelper.cpp
src/modules/airline/Airline.cpp
src/modules/image/Image.cpp
src/modules/crypto/Crypto.cpp
src/modules/computer/Computer.cpp
src/modules/vehicle/Vehicle.cpp
src/modules/science/Science.cpp
src/modules/structure/Structure.cpp
src/common/JsonHelper.cpp)
)

set(FAKER_UT_SOURCES
src/modules/animal/AnimalTest.cpp
Expand Down Expand Up @@ -96,15 +94,14 @@ set(FAKER_UT_SOURCES
src/modules/videoGame/VideoGameTest.cpp
src/modules/medicine/MedicineTest.cpp
src/modules/weather/WeatherTest.cpp
src/common/WeatherHelperTest.cpp
src/modules/airline/AirlineTest.cpp
src/modules/image/ImageTest.cpp
src/modules/crypto/CryptoTest.cpp
src/modules/computer/ComputerTest.cpp
src/modules/vehicle/VehicleTest.cpp
src/modules/science/ScienceTest.cpp
src/modules/structure/StructureTest.cpp
src/common/JsonHelperTest.cpp)
)

add_library(${LIBRARY_NAME} ${FAKER_SOURCES})

Expand All @@ -113,15 +110,15 @@ target_include_directories(
INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include"
PRIVATE "${CMAKE_CURRENT_LIST_DIR}/include")

if(APPLE OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION
VERSION_LESS 12))
if (APPLE OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION
VERSION_LESS 12))

add_subdirectory(externals/fmt)
set(FMT_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/fmt/include")
target_link_libraries(${LIBRARY_NAME} PRIVATE fmt)
endif()
endif ()

if(BUILD_FAKER_TESTS)
if (BUILD_FAKER_TESTS)
add_subdirectory(externals/googletest)

set(GTEST_INCLUDE_DIR
Expand All @@ -140,27 +137,27 @@ if(BUILD_FAKER_TESTS)
add_executable(${LIBRARY_NAME}-UT ${FAKER_UT_SOURCES})

target_link_libraries(${LIBRARY_NAME}-UT PRIVATE gtest_main gmock_main
faker-cxx)
faker-cxx)

if(APPLE OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12))
if (APPLE OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12))

target_link_libraries(${LIBRARY_NAME}-UT PRIVATE fmt)
target_include_directories(
${LIBRARY_NAME}-UT
PRIVATE ${FMT_INCLUDE_DIR} ${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR} ${CMAKE_CURRENT_LIST_DIR})
else()
${GMOCK_INCLUDE_DIR} ${CMAKE_CURRENT_LIST_DIR})
else ()
target_include_directories(
${LIBRARY_NAME}-UT
PRIVATE ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR}
${CMAKE_CURRENT_LIST_DIR})
endif()
${CMAKE_CURRENT_LIST_DIR})
endif ()

add_test(
NAME ${LIBRARY_NAME}-UT
COMMAND ${LIBRARY_NAME}-UT
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

target_code_coverage(${LIBRARY_NAME}-UT ALL)
endif()
endif ()
8 changes: 0 additions & 8 deletions Dockerfile.gcc13

This file was deleted.

Loading

0 comments on commit ee834b6

Please sign in to comment.