Skip to content

Commit

Permalink
Always build "internal" library as static (#1725)
Browse files Browse the repository at this point in the history
* Always build oqs-internal library as static

Signed-off-by: Spencer Wilson <[email protected]>
  • Loading branch information
SWilson4 authored Mar 13, 2024
1 parent d035350 commit 1bc6d11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ add_library(oqs kem/kem.c
${COMMON_OBJS})

# Internal library to be used only by test programs
add_library(oqs-internal ${INTERNAL_OBJS})
add_library(oqs-internal STATIC ${INTERNAL_OBJS})

if(DEFINED SANITIZER_LD_FLAGS)
target_link_libraries(oqs PUBLIC ${SANITIZER_LD_FLAGS})
Expand Down
8 changes: 8 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ target_link_libraries(example_kem PRIVATE ${TEST_DEPS})

add_executable(kat_kem kat_kem.c test_helpers.c)
target_link_libraries(kat_kem PRIVATE ${TEST_DEPS})
if(CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows" AND BUILD_SHARED_LIBS)
# workaround for Windows .dll cross-compiling
target_link_options(kat_kem PRIVATE -Wl,--allow-multiple-definition)
endif()

add_executable(test_kem test_kem.c)
target_link_libraries(test_kem PRIVATE ${TEST_DEPS})
Expand All @@ -82,6 +86,10 @@ target_link_libraries(example_sig PRIVATE ${TEST_DEPS})

add_executable(kat_sig kat_sig.c test_helpers.c)
target_link_libraries(kat_sig PRIVATE ${TEST_DEPS})
if(CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows" AND BUILD_SHARED_LIBS)
# workaround for Windows .dll cross-compiling
target_link_options(kat_sig PRIVATE -Wl,--allow-multiple-definition)
endif()

add_executable(test_sig test_sig.c)
target_link_libraries(test_sig PRIVATE ${TEST_DEPS})
Expand Down

0 comments on commit 1bc6d11

Please sign in to comment.