Skip to content

Commit

Permalink
cmake: Use fizzy::fizzy-internal
Browse files Browse the repository at this point in the history
Instead of including the directory with internal headers directly.
  • Loading branch information
chfast committed Sep 30, 2020
1 parent 745a296 commit 1b7ca6f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 13 deletions.
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ if(HUNTER_ENABLED)
endif()
find_package(GTest REQUIRED)

set(fizzy_include_dir ${PROJECT_SOURCE_DIR}/lib/fizzy)

add_subdirectory(utils)
add_subdirectory(bench)
add_subdirectory(bench_internal)
Expand Down
3 changes: 1 addition & 2 deletions test/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

add_executable(fizzy-bench bench.cpp)
target_compile_features(fizzy-bench PRIVATE cxx_std_17)
target_link_libraries(fizzy-bench PRIVATE fizzy::fizzy fizzy::test-utils benchmark::benchmark)
target_include_directories(fizzy-bench PRIVATE ${fizzy_include_dir})
target_link_libraries(fizzy-bench PRIVATE fizzy::fizzy-internal fizzy::test-utils benchmark::benchmark)

if(UNIX AND NOT APPLE)
# For libstdc++ up to version 8 (included) this is needed for proper <filesystem> support.
Expand Down
3 changes: 1 addition & 2 deletions test/bench_internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ target_sources(fizzy-bench-internal PRIVATE
parser_benchmarks.cpp
)

target_link_libraries(fizzy-bench-internal PRIVATE fizzy::fizzy fizzy::test-utils benchmark::benchmark_main)
target_include_directories(fizzy-bench-internal PRIVATE ${fizzy_include_dir})
target_link_libraries(fizzy-bench-internal PRIVATE fizzy::fizzy-internal fizzy::test-utils benchmark::benchmark_main)
3 changes: 1 addition & 2 deletions test/fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

add_executable(fizzy-fuzz-parser parser_fuzzer.cpp)
target_link_options(fizzy-fuzz-parser PRIVATE -fsanitize=fuzzer)
target_link_libraries(fizzy-fuzz-parser PRIVATE fizzy::fizzy)
target_include_directories(fizzy-fuzz-parser PRIVATE ${fizzy_include_dir})
target_link_libraries(fizzy-fuzz-parser PRIVATE fizzy::fizzy-internal)
3 changes: 1 addition & 2 deletions test/spectests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ find_package(nlohmann_json REQUIRED)

add_executable(fizzy-spectests spectests.cpp)
target_compile_features(fizzy-spectests PRIVATE cxx_std_17)
target_link_libraries(fizzy-spectests PRIVATE fizzy::fizzy fizzy::test-utils nlohmann_json::nlohmann_json)
target_include_directories(fizzy-spectests PRIVATE ${fizzy_include_dir})
target_link_libraries(fizzy-spectests PRIVATE fizzy::fizzy-internal fizzy::test-utils nlohmann_json::nlohmann_json)

if(UNIX AND NOT APPLE)
# For libstdc++ up to version 8 (included) this is needed for proper <filesystem> support.
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
include(GoogleTest)

add_executable(fizzy-unittests)
target_link_libraries(fizzy-unittests PRIVATE fizzy::fizzy fizzy::test-utils GTest::gtest_main GTest::gmock)
target_link_libraries(fizzy-unittests PRIVATE fizzy::fizzy-internal fizzy::test-utils GTest::gtest_main GTest::gmock)

target_sources(
fizzy-unittests PRIVATE
Expand Down
4 changes: 2 additions & 2 deletions test/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ target_sources(
)

target_compile_features(test-utils PUBLIC cxx_std_17)
target_include_directories(test-utils PUBLIC ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/lib/fizzy)
target_link_libraries(test-utils PRIVATE fizzy::fizzy wabt::wabt wasm3::wasm3 GTest::gtest)
target_include_directories(test-utils PUBLIC ${PROJECT_SOURCE_DIR})
target_link_libraries(test-utils PRIVATE fizzy::fizzy-internal wabt::wabt wasm3::wasm3 GTest::gtest)

0 comments on commit 1b7ca6f

Please sign in to comment.