Skip to content

Commit 6796339

Browse files
committed
fix compilation
1 parent ceb0bc1 commit 6796339

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
1414
message(STATUS "${PROJECT_NAME} is top level")
1515
endif()
1616

17-
option(PLIB_ENABLE_TESTS "Enable building tests" ${is_root_project})
18-
option(PLIB_BUILD_PSCRIPT_DEMO_APP "Enable pscript demo app" ON) # TODO: set default to off
17+
option(PSCRIPT_ENABLE_TESTS "Enable building tests" ${is_root_project})
18+
option(PSCRIPT_BUILD_DEMO_APP "Enable pscript demo app" ON) # TODO: set default to off
1919

2020
if(${PSCRIPT_ENABLE_TESTS})
2121
add_subdirectory(tests)
@@ -35,6 +35,11 @@ FetchContent_Declare(
3535

3636
FetchContent_MakeAvailable(plib)
3737

38+
FetchContent_Declare(
39+
fmt
40+
GIT_REPOSITORY https://github.com/fmtlib/fmt
41+
)
42+
FetchContent_MakeAvailable(fmt)
3843

3944
add_library(pscript STATIC)
4045
target_sources(pscript PRIVATE
@@ -46,7 +51,10 @@ target_sources(pscript PRIVATE
4651
)
4752
target_include_directories(pscript PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ${peglib_SOURCE_DIR})
4853

49-
target_compile_options(plib PRIVATE "-Wno-format")
54+
55+
target_link_libraries(pscript PUBLIC fmt plib)
56+
target_include_directories(pscript PUBLIC ${fmt_SOURCE_DIR}/include)
57+
target_compile_options(pscript PRIVATE "-Wno-format")
5058

5159
# copy over modules to build directory
5260
file(GLOB_RECURSE MODULE_FILES "modules/*")

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FetchContent_Declare(
1010
FetchContent_MakeAvailable(catch2)
1111

1212
add_executable(pscript-test main.cpp)
13-
target_link_libraries(pscript-test PRIVATE plib Catch2::Catch2WithMain)
13+
target_link_libraries(pscript-test PRIVATE pscript Catch2::Catch2WithMain)
1414
target_compile_options(pscript-test PRIVATE -Wno-macro-redefined -Wno-format)
1515

1616
if (${PSCRIPT_BUILD_DEMO_APP})

0 commit comments

Comments
 (0)