File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,21 @@ file(GLOB NANOTS_SOURCES
1515 ${CMAKE_CURRENT_SOURCE_DIR} /*.c
1616)
1717
18+ # Build static library
1819add_library (
19- nanots STATIC
20+ nanots_static STATIC
21+ ${NANOTS_HEADERS}
22+ ${NANOTS_SOURCES}
23+ )
24+
25+ target_include_directories (
26+ nanots_static PUBLIC
27+ ${CMAKE_CURRENT_SOURCE_DIR}
28+ )
29+
30+ # Build shared library
31+ add_library (
32+ nanots SHARED
2033 ${NANOTS_HEADERS}
2134 ${NANOTS_SOURCES}
2235)
@@ -26,4 +39,17 @@ target_include_directories(
2639 ${CMAKE_CURRENT_SOURCE_DIR}
2740)
2841
42+ # Set output names to avoid conflicts
43+ set_target_properties (nanots_static PROPERTIES
44+ OUTPUT_NAME "nanots_static"
45+ )
46+
47+ set_target_properties (nanots PROPERTIES
48+ OUTPUT_NAME "nanots"
49+ )
50+
51+ # Link platform dependencies to both libraries
52+ target_link_libraries (nanots_static PUBLIC platform::platform )
53+ target_link_libraries (nanots PUBLIC platform::platform )
54+
2955add_subdirectory (ut )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ target_include_directories(
1818)
1919
2020target_link_libraries (
21- nanots_ut LINK_PUBLIC
22- nanots
21+ nanots_ut LINK_PUBLIC
22+ nanots_static
2323 platform::platform
2424)
You can’t perform that action at this time.
0 commit comments