squall/storm/CMakeLists.txt

89 lines
2 KiB
Text
Raw Normal View History

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wno-invalid-offsetof HAS_NO_INVALID_OFFSETOF)
file(GLOB STORM_SOURCES
"*.cpp"
2023-01-23 22:10:24 -06:00
"big/*.cpp"
2023-03-23 12:48:16 -05:00
"crypto/*.cpp"
2023-03-23 12:51:42 -05:00
"error/*.cpp"
2020-11-15 13:20:10 -06:00
"hash/*.cpp"
"queue/*.cpp"
2020-11-14 17:18:49 -06:00
"string/*.cpp"
2020-09-09 00:45:46 -05:00
"thread/*.cpp"
)
2020-12-02 20:04:02 -06:00
if(WHOA_SYSTEM_WIN)
file(GLOB STORM_WIN_SOURCES
"win/*.cpp"
"error/win/*.cpp"
2023-03-23 12:51:42 -05:00
"thread/win/*.cpp"
)
list(APPEND STORM_SOURCES ${STORM_WIN_SOURCES})
endif()
2020-12-02 20:04:02 -06:00
if(WHOA_SYSTEM_MAC)
file(GLOB STORM_MAC_SOURCES
"mac/*.cpp"
"mac/*.mm"
2020-09-09 00:45:46 -05:00
"thread/mac/*.cpp"
"thread/mac/*.mm"
)
list(APPEND STORM_SOURCES ${STORM_MAC_SOURCES})
endif()
if(WHOA_SYSTEM_LINUX)
file(GLOB STORM_LINUX_SOURCES
"linux/*.cpp"
"thread/linux/*.cpp"
)
list(APPEND STORM_SOURCES ${STORM_LINUX_SOURCES})
endif()
list(APPEND STORM_SOURCES "file/SFileClass.cpp")
if(WHOA_SFILE_MODE STREQUAL "STORMLIB")
list(APPEND STORM_SOURCES "file/SFile.cpp")
else()
list(APPEND STORM_SOURCES "file/SFileNative.cpp")
endif()
add_library(storm STATIC
${STORM_SOURCES}
)
2025-09-23 15:19:21 -07:00
target_compile_definitions(storm PRIVATE _CRT_SECURE_NO_WARNINGS)
target_compile_definitions(storm PUBLIC WHOA_SFILE_MODE_${WHOA_SFILE_MODE})
2025-09-23 15:19:21 -07:00
target_include_directories(storm
PUBLIC
2020-11-01 17:45:45 -06:00
${PROJECT_SOURCE_DIR}
)
2020-12-02 20:04:02 -06:00
target_link_libraries(storm
PRIVATE
system
)
if(HAS_NO_INVALID_OFFSETOF)
target_compile_options(storm
PUBLIC
-Wno-invalid-offsetof
)
endif()
2025-08-28 15:18:08 -07:00
# Standalone builds
if(WHOA_STANDALONE)
# Debug build options
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# GCC debug build options
if(CMAKE_COMPILER_IS_GNUCXX)
# Enable coverage reporting
include(CodeCoverage)
target_compile_options(${PROJECT_NAME} PRIVATE -g -fprofile-arcs -ftest-coverage -O0)
# Enable ASan
target_compile_options(storm PRIVATE -fsanitize=address -fno-omit-frame-pointer)
endif()
endif()
2025-08-28 15:18:08 -07:00
endif()