File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,11 @@ target_compile_definitions(scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MINOR=${PROJ
139139target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_PATCH=${PROJECT_VERSION_PATCH} )
140140
141141# Unit tests
142+ target_link_libraries (scratchcpp PRIVATE scratchcpp-test -export)
143+
142144if (LIBSCRATCHCPP_BUILD_UNIT_TESTS)
145+ target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_TEST)
146+
143147 enable_testing ()
144148 add_subdirectory (test )
145149endif ()
Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ target_sources(scratchcpp
1111 rect_p.h
1212)
1313
14+ add_library (scratchcpp-test -export
15+ INTERFACE
16+ test_export.h
17+ )
18+
19+ target_include_directories (scratchcpp-test -export INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} )
20+
1421add_subdirectory (blocks)
1522add_subdirectory (engine)
1623add_subdirectory (internal )
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+
3+ #pragma once
4+
5+ #ifdef LIBSCRATCHCPP_TEST
6+ #if defined(_MSC_VER ) || defined(WIN64 ) || defined(_WIN64 ) || defined(__WIN64__ ) || defined(WIN32 ) || defined(_WIN32 ) || defined(__WIN32__ ) || defined(__NT__ )
7+ #define LIBSCRATCHCPP_TEST_EXPORT __declspec(dllexport)
8+ #else
9+ #define LIBSCRATCHCPP_TEST_EXPORT __attribute__((visibility("default")))
10+ #endif
11+ #else
12+ #define LIBSCRATCHCPP_TEST_EXPORT
13+ #endif
You can’t perform that action at this time.
0 commit comments