Skip to content

Commit

Permalink
Explicitly link to advapi32 to fix Windows ARM32 linker failure. (Azu…
Browse files Browse the repository at this point in the history
…re#1669)

After Azure@b21239b
the Windows ARM32 build would fail to link the libiothsm unit test binaries
because the linker could not find `ReportEventA` and `RegisterEventSourceA`.

This is probably the same as when the Windows ARM32 support was
originally added and we had to link the unit tests to shell32 explicitly,
even though the Windows AMD64 build did not complain.
  • Loading branch information
arsing authored Sep 5, 2019
1 parent 60e6a80 commit 651db3b
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion edgelet/hsm-sys/azure-iot-hsm-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ if (save_ut)
endif(save_ut)

if(WIN32)
target_link_libraries(iothsm aziotsharedutil utpm $ENV{OPENSSL_ROOT_DIR}/lib/ssleay32.lib $ENV{OPENSSL_ROOT_DIR}/lib/libeay32.lib)
target_link_libraries(iothsm aziotsharedutil utpm $ENV{OPENSSL_ROOT_DIR}/lib/ssleay32.lib $ENV{OPENSSL_ROOT_DIR}/lib/libeay32.lib advapi32)
else()
target_link_libraries(iothsm aziotsharedutil utpm ${OPENSSL_LIBRARIES})
endif(WIN32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests/azure_c_shared_utility_tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests/azure_c_shared_utility_tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests/azure_c_shared_utility_tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests/azure_c_shared_utility_tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests/azure_c_shared_utility_tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ set(${theseTestsName}_h_files
)

build_c_test_artifacts(${theseTestsName} ON "tests")

if(WIN32)
target_link_libraries(${theseTestsName}_exe advapi32)
endif(WIN32)

0 comments on commit 651db3b

Please sign in to comment.