2023-04-22 14:13:57 -04:00
|
|
|
function(write_revision_h)
|
|
|
|
find_package(Git)
|
|
|
|
set(GIT_SHORT_SHA "")
|
|
|
|
set(GIT_TAG "")
|
|
|
|
if(NOT GIT_FOUND)
|
|
|
|
MESSAGE(STATUS "write_revision_h(): git was not found")
|
|
|
|
endif()
|
|
|
|
MESSAGE(STATUS "write_revision_h(): ${CMAKE_SOURCE_DIR}")
|
|
|
|
if (GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
|
|
|
MESSAGE(STATUS "Git found, using it to get revision info")
|
|
|
|
EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
|
|
|
OUTPUT_VARIABLE GIT_SHORT_SHA
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD
|
|
|
|
OUTPUT_VARIABLE GIT_TAG
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
ERROR_QUIET)
|
|
|
|
endif()
|
|
|
|
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/versions/revision.h "#define BUILT_TAG \"${GIT_TAG}\"\n#define BUILT_SHA \"${GIT_SHORT_SHA}\"\n")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
write_revision_h()
|
|
|
|
|
2021-01-06 12:16:39 -05:00
|
|
|
add_library(common
|
2021-07-18 19:28:56 -04:00
|
|
|
audio/audio_formats.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
cross_os_debug/xdbg.cpp
|
2022-05-06 18:19:37 -04:00
|
|
|
cross_sockets/XSocket.cpp
|
2022-06-11 11:32:27 -04:00
|
|
|
cross_sockets/XSocketClient.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
cross_sockets/XSocketServer.cpp
|
2022-06-19 20:44:07 -04:00
|
|
|
custom_data/pack_helpers.cpp
|
2021-12-04 12:33:18 -05:00
|
|
|
custom_data/TFrag3Data.cpp
|
2021-10-31 13:12:50 -04:00
|
|
|
dma/dma_copy.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
dma/dma.cpp
|
2021-10-31 13:12:50 -04:00
|
|
|
dma/gs.cpp
|
2023-07-08 21:53:39 -04:00
|
|
|
formatter/formatter_tree.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
formatter/formatter.cpp
|
2023-08-05 15:23:09 -04:00
|
|
|
formatter/formatter_tree.cpp
|
|
|
|
formatter/rules/formatting_rules.cpp
|
|
|
|
formatter/rules/rule_config.cpp
|
2022-04-17 21:12:24 -04:00
|
|
|
global_profiler/GlobalProfiler.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
goos/Interpreter.cpp
|
|
|
|
goos/Object.cpp
|
|
|
|
goos/ParseHelpers.cpp
|
|
|
|
goos/PrettyPrinter.cpp
|
2021-12-04 16:06:01 -05:00
|
|
|
goos/PrettyPrinter2.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
goos/Printer.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
goos/Reader.cpp
|
|
|
|
goos/TextDB.cpp
|
|
|
|
log/log.cpp
|
2022-06-11 11:32:27 -04:00
|
|
|
math/geometry.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
repl/config.cpp
|
2023-01-07 11:24:02 -05:00
|
|
|
repl/nrepl/ReplClient.cpp
|
|
|
|
repl/nrepl/ReplServer.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
repl/util.cpp
|
2023-07-08 21:53:39 -04:00
|
|
|
serialization/subtitles/subtitles_v1.cpp
|
|
|
|
serialization/subtitles/subtitles_v2.cpp
|
|
|
|
serialization/subtitles/subtitles.cpp
|
|
|
|
serialization/text/text_ser.cpp
|
2023-06-25 16:51:46 -04:00
|
|
|
sqlite/sqlite.cpp
|
2023-07-14 18:17:54 -04:00
|
|
|
texture/texture_slots.cpp
|
2021-04-19 20:29:38 -04:00
|
|
|
type_system/defenum.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
type_system/deftype.cpp
|
2021-07-17 18:07:21 -04:00
|
|
|
type_system/state.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
type_system/Type.cpp
|
|
|
|
type_system/TypeFieldLookup.cpp
|
|
|
|
type_system/TypeSpec.cpp
|
|
|
|
type_system/TypeSystem.cpp
|
2022-02-08 19:02:47 -05:00
|
|
|
util/Assert.cpp
|
2024-03-30 19:49:07 -04:00
|
|
|
util/ast_util.cpp
|
2021-05-18 21:25:29 -04:00
|
|
|
util/BitUtils.cpp
|
2021-09-21 22:52:18 -04:00
|
|
|
util/compress.cpp
|
2022-04-15 20:40:10 -04:00
|
|
|
util/crc32.cpp
|
2021-01-27 20:46:58 -05:00
|
|
|
util/dgo_util.cpp
|
|
|
|
util/DgoReader.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
util/DgoWriter.cpp
|
2023-06-30 21:05:58 -04:00
|
|
|
util/dialogs.cpp
|
2021-10-12 20:33:26 -04:00
|
|
|
util/diff.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
util/FileUtil.cpp
|
2022-10-11 18:30:26 -04:00
|
|
|
util/FontUtils.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
util/FrameLimiter.cpp
|
2021-03-13 16:10:39 -05:00
|
|
|
util/json_util.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
util/os.cpp
|
|
|
|
util/print_float.cpp
|
2022-04-12 20:15:30 -04:00
|
|
|
util/read_iso_file.cpp
|
2022-04-15 20:40:10 -04:00
|
|
|
util/SimpleThreadGroup.cpp
|
2023-01-07 10:35:12 -05:00
|
|
|
util/string_util.cpp
|
2023-04-24 23:46:55 -04:00
|
|
|
util/term_util.cpp
|
2021-01-06 12:16:39 -05:00
|
|
|
util/Timer.cpp
|
2023-01-07 10:35:12 -05:00
|
|
|
util/unicode_util.cpp
|
2024-04-01 18:56:55 -04:00
|
|
|
versions/versions.cpp)
|
2021-01-06 12:16:39 -05:00
|
|
|
|
2023-06-30 21:05:58 -04:00
|
|
|
target_link_libraries(common fmt lzokay replxx libzstd_static tree-sitter sqlite3 libtinyfiledialogs)
|
2021-01-06 12:16:39 -05:00
|
|
|
|
2021-02-03 21:29:46 -05:00
|
|
|
if(WIN32)
|
2022-02-05 16:30:50 -05:00
|
|
|
target_link_libraries(common wsock32 ws2_32 windowsapp)
|
2022-12-22 17:12:05 -05:00
|
|
|
elseif(APPLE)
|
|
|
|
# don't need anything special
|
2021-02-03 21:29:46 -05:00
|
|
|
else()
|
2021-01-06 12:16:39 -05:00
|
|
|
target_link_libraries(common stdc++fs)
|
2021-02-03 21:29:46 -05:00
|
|
|
endif()
|