Skip to content

Commit 1c4c479

Browse files
committed
fix: adding fmt as a cmake target instead of compiling its sources on every target
1 parent 75fd732 commit 1c4c479

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2626

2727
# files needed for the library ArkReactor
2828
file(GLOB_RECURSE SOURCE_FILES
29-
${ark_SOURCE_DIR}/src/arkreactor/*.cpp
30-
${ark_SOURCE_DIR}/lib/fmt/src/format.cc)
29+
${ark_SOURCE_DIR}/src/arkreactor/*.cpp)
3130

3231
add_library(ArkReactor SHARED ${SOURCE_FILES})
3332

@@ -97,15 +96,15 @@ endif()
9796

9897
# Link libraries
9998

100-
add_subdirectory("${ark_SOURCE_DIR}/lib/termcolor" EXCLUDE_FROM_ALL)
99+
add_subdirectory(${ark_SOURCE_DIR}/lib/termcolor EXCLUDE_FROM_ALL)
100+
add_subdirectory(${ark_SOURCE_DIR}/lib/fmt EXCLUDE_FROM_ALL)
101101

102102
target_include_directories(ArkReactor
103103
PUBLIC
104-
"${ark_SOURCE_DIR}/lib/utf8_decoder/"
105-
"${ark_SOURCE_DIR}/lib/picosha2/"
106-
"${ark_SOURCE_DIR}/lib/fmt/include")
104+
${ark_SOURCE_DIR}/lib/utf8_decoder/
105+
${ark_SOURCE_DIR}/lib/picosha2/)
107106

108-
target_link_libraries(ArkReactor PUBLIC termcolor)
107+
target_link_libraries(ArkReactor PUBLIC termcolor fmt::fmt-header-only)
109108

110109
if (UNIX OR LINUX)
111110
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
@@ -186,8 +185,7 @@ if (ARK_BUILD_EXE)
186185
set(EXE_SOURCES
187186
${ark_SOURCE_DIR}/src/arkscript/REPL/Utils.cpp
188187
${ark_SOURCE_DIR}/src/arkscript/REPL/Repl.cpp
189-
${ark_SOURCE_DIR}/src/arkscript/main.cpp
190-
${ark_SOURCE_DIR}/lib/fmt/src/format.cc)
188+
${ark_SOURCE_DIR}/src/arkscript/main.cpp)
191189

192190
add_executable(arkscript ${EXE_SOURCES})
193191

src/arkreactor/Builtins/IO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace Ark::internal::Builtins::IO
6464
if (types::check(n, ValueType::String))
6565
fmt::print(n[0].string());
6666
else if (n.size() != 0)
67-
types::generateError("input", { { types::Contract {{}}, types::Contract { { types::Typedef("prompt", ValueType::String) } } } }, n);
67+
types::generateError("input", { { types::Contract {}, types::Contract { { types::Typedef("prompt", ValueType::String) } } } }, n);
6868

6969
std::string line = "";
7070
std::getline(std::cin, line);

0 commit comments

Comments
 (0)