Skip to content

Commit f3a184b

Browse files
authored
cmake : remove precompiled headers (ggml-org#28892)
This commit removes the precompiled headers that I added in Commit 3bcfeb7 ("cmake : add PCH and unity build to improve build times (ggml-org#28091)"). The motivation for this is that this looked good when developing this but has caused multiple issues that I had taken into consideration and we have decided to remove it and only keep the unity builds from the above commit. Refs: ggml-org#28882 (comment)
1 parent dfe4516 commit f3a184b

5 files changed

Lines changed: 0 additions & 28 deletions

File tree

‎common/CMakeLists.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ set_target_properties(${TARGET} PROPERTIES
136136
target_include_directories(${TARGET} PUBLIC .)
137137
target_link_libraries (${TARGET} PUBLIC vendor::nlohmann vendor::sheredom)
138138
target_compile_features (${TARGET} PUBLIC cxx_std_17)
139-
target_precompile_headers (${TARGET} PRIVATE common.h)
140-
target_precompile_headers (${TARGET} PRIVATE chat.h)
141139

142140
if (LLAMA_SUBPROCESS)
143141
target_compile_definitions(${TARGET} PUBLIC LLAMA_SUBPROCESS)

‎src/CMakeLists.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ configure_file(llama-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/llama-version.h @O
6767
target_include_directories(llama PRIVATE . ${CMAKE_CURRENT_BINARY_DIR})
6868
target_include_directories(llama PUBLIC ../include)
6969
target_compile_features (llama PRIVATE cxx_std_17) # don't bump
70-
target_precompile_headers (llama PRIVATE models/models.h)
7170

7271
target_link_libraries(llama PUBLIC ggml)
7372

‎tests/CMakeLists.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,6 @@ llama_build_and_test(
275275
peg-parser/test-unicode.cpp
276276
peg-parser/tests.h
277277
)
278-
target_precompile_headers(test-peg-parser PRIVATE peg-parser/tests.h)
279-
280278

281279
if (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "s390x")
282280
set(MODEL_NAME "tinyllamas/stories15M-q4_0.gguf")

‎tools/mtmd/CMakeLists.txt‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@ target_link_libraries (mtmd PUBLIC ggml llama)
8484
target_link_libraries (mtmd PRIVATE Threads::Threads vendor::hash vendor::miniaudio vendor::stb vendor::sheredom)
8585
target_include_directories(mtmd PUBLIC .)
8686
target_compile_features (mtmd PRIVATE cxx_std_17)
87-
target_precompile_headers (mtmd PRIVATE models/models.h)
88-
89-
set_source_files_properties(
90-
mtmd-helper.cpp
91-
mtmd-helper-gen.cpp
92-
PROPERTIES SKIP_PRECOMPILE_HEADERS ON
93-
)
9487

9588
if (MTMD_VIDEO)
9689
target_compile_definitions(mtmd PRIVATE MTMD_VIDEO)

‎tools/server/CMakeLists.txt‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
22

3-
# MSVC emits a PCH bookkeeping symbol that WINDOWS_EXPORT_ALL_SYMBOLS exports as an ambiguous "__"
4-
5-
set(LLAMA_SERVER_PCH ON)
6-
7-
if (BUILD_SHARED_LIBS AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
8-
set(LLAMA_SERVER_PCH OFF)
9-
endif()
10-
113
# server-context containing the core server logic, used by llama-server and CLI
124

135
set(TARGET server-context)
@@ -41,10 +33,6 @@ target_include_directories(${TARGET} PRIVATE ../mtmd)
4133
target_include_directories(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR})
4234
target_link_libraries(${TARGET} PUBLIC llama-common mtmd ${CMAKE_THREAD_LIBS_INIT})
4335

44-
if (LLAMA_SERVER_PCH)
45-
target_precompile_headers(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR}/common/common.h)
46-
endif()
47-
4836
# llama-server-impl: server logic, reusable by app
4937

5038
set(TARGET llama-server-impl)
@@ -62,10 +50,6 @@ target_include_directories(${TARGET} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
6250
target_include_directories(${TARGET} PRIVATE ../mtmd ${CMAKE_SOURCE_DIR})
6351
target_link_libraries(${TARGET} PUBLIC server-context llama-ui cpp-httplib ${CMAKE_THREAD_LIBS_INIT})
6452

65-
if (LLAMA_SERVER_PCH)
66-
target_precompile_headers(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR}/common/common.h)
67-
endif()
68-
6953
add_dependencies(${TARGET} llama-ui-assets)
7054

7155
if(LLAMA_TOOLS_INSTALL)

0 commit comments

Comments
 (0)