mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-23 22:29:53 +00:00
0a15ac1669
I believe this brings things back in line to where it was before: Here are the first handful of files before the changes: ``` 0.014 | gcommon.gc 0.006 | gkernel-h.gc 0.025 | gkernel.gc 0.002 | pskernel.gc 0.01 | gstring.gc 0.004 | gstate.gc 0.001 | kernel.gd 0.001 | types-h.gc 0.002 | vu1-macros.gc 0.003 | math.gc 0.01 | vector-h.gc 0.001 | gravity-h.gc 0.001 | bounding-box-h.gc 0.001 | matrix-h.gc 0.001 | quaternion-h.gc 0.001 | euler-h.gc ``` > first compile ``` 0.161 | gcommon.gc 0.126 | gkernel-h.gc 0.174 | gkernel.gc 0.046 | pskernel.gc 0.08 | gstring.gc 0.048 | gstate.gc 0.001 | kernel.gd 0.052 | types-h.gc 0.009 | vu1-macros.gc 0.059 | math.gc 0.228 | vector-h.gc 0.026 | gravity-h.gc 0.006 | bounding-box-h.gc 0.002 | matrix-h.gc 0.028 | quaternion-h.gc 0.026 | euler-h.gc ``` > make a change in gcommon and recompile With the changes: ``` 0.015 | gcommon.gc 0.018 | gkernel-h.gc 0.039 | gkernel.gc 0.006 | pskernel.gc 0.015 | gstring.gc 0.009 | gstate.gc 0.005 | kernel.gd 0.006 | types-h.gc 0.006 | vu1-macros.gc 0.008 | math.gc 0.017 | vector-h.gc 0.004 | gravity-h.gc 0.004 | bounding-box-h.gc 0.005 | matrix-h.gc 0.005 | quaternion-h.gc 0.003 | euler-h.gc ``` > First compile, no difference expected ``` 0.016 | gcommon.gc 0.008 | gkernel-h.gc 0.023 | gkernel.gc 0.002 | pskernel.gc 0.01 | gstring.gc 0.043 | gstate.gc 0.001 | kernel.gd 0.002 | types-h.gc 0.002 | vu1-macros.gc 0.003 | math.gc 0.013 | vector-h.gc 0.001 | gravity-h.gc 0.002 | bounding-box-h.gc 0.002 | matrix-h.gc 0.001 | quaternion-h.gc 0.001 | euler-h.gc ``` > Compile times seem to be back within margin of error -- some are faster than the first compilation time.
101 lines
3.2 KiB
CMake
101 lines
3.2 KiB
CMake
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()
|
|
|
|
add_library(common
|
|
audio/audio_formats.cpp
|
|
cross_os_debug/xdbg.cpp
|
|
cross_sockets/XSocket.cpp
|
|
cross_sockets/XSocketClient.cpp
|
|
cross_sockets/XSocketServer.cpp
|
|
custom_data/pack_helpers.cpp
|
|
custom_data/TFrag3Data.cpp
|
|
dma/dma_copy.cpp
|
|
dma/dma.cpp
|
|
dma/gs.cpp
|
|
formatter/formatter_tree.cpp
|
|
formatter/formatter.cpp
|
|
formatter/formatter_tree.cpp
|
|
formatter/rules/formatting_rules.cpp
|
|
formatter/rules/rule_config.cpp
|
|
global_profiler/GlobalProfiler.cpp
|
|
goos/Interpreter.cpp
|
|
goos/Object.cpp
|
|
goos/ParseHelpers.cpp
|
|
goos/PrettyPrinter.cpp
|
|
goos/PrettyPrinter2.cpp
|
|
goos/Printer.cpp
|
|
goos/Reader.cpp
|
|
goos/TextDB.cpp
|
|
log/log.cpp
|
|
math/geometry.cpp
|
|
repl/config.cpp
|
|
repl/nrepl/ReplClient.cpp
|
|
repl/nrepl/ReplServer.cpp
|
|
repl/util.cpp
|
|
serialization/subtitles/subtitles_v1.cpp
|
|
serialization/subtitles/subtitles_v2.cpp
|
|
serialization/subtitles/subtitles.cpp
|
|
serialization/text/text_ser.cpp
|
|
sqlite/sqlite.cpp
|
|
texture/texture_slots.cpp
|
|
type_system/defenum.cpp
|
|
type_system/deftype.cpp
|
|
type_system/state.cpp
|
|
type_system/Type.cpp
|
|
type_system/TypeFieldLookup.cpp
|
|
type_system/TypeSpec.cpp
|
|
type_system/TypeSystem.cpp
|
|
util/Assert.cpp
|
|
util/ast_util.cpp
|
|
util/BitUtils.cpp
|
|
util/compress.cpp
|
|
util/crc32.cpp
|
|
util/dgo_util.cpp
|
|
util/DgoReader.cpp
|
|
util/DgoWriter.cpp
|
|
util/dialogs.cpp
|
|
util/diff.cpp
|
|
util/FileUtil.cpp
|
|
util/FontUtils.cpp
|
|
util/FrameLimiter.cpp
|
|
util/json_util.cpp
|
|
util/os.cpp
|
|
util/print_float.cpp
|
|
util/read_iso_file.cpp
|
|
util/SimpleThreadGroup.cpp
|
|
util/string_util.cpp
|
|
util/term_util.cpp
|
|
util/Timer.cpp
|
|
util/unicode_util.cpp
|
|
versions/versions.cpp)
|
|
|
|
target_link_libraries(common fmt lzokay replxx libzstd_static tree-sitter sqlite3 libtinyfiledialogs)
|
|
|
|
if(WIN32)
|
|
target_link_libraries(common wsock32 ws2_32 windowsapp)
|
|
elseif(APPLE)
|
|
# don't need anything special
|
|
else()
|
|
target_link_libraries(common stdc++fs)
|
|
endif()
|