Description: Disable LTO for tests
 With LTO enabled the linker is not able to find __wrap_RAND_bytes which
 was enabled with the gcc option "--wrap=RAND_bytes".
Author: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Bug-Ubuntu: https://launchpad.net/bugs/2060262
Forwarded: https://github.com/kaoh/globalplatform/issues/95
Last-Update: 2024-04-05
---

--- globalplatform-2.4.0+dfsg.orig/globalplatform/src/CMakeLists.txt
+++ globalplatform-2.4.0+dfsg/globalplatform/src/CMakeLists.txt
@@ -139,17 +139,19 @@ IF(TESTING)
     IF(UNIX AND NOT APPLE)
       add_mocked_test(scp03Test
         SOURCES scp03Test.c testUtil.c ${SOURCES}
-        COMPILE_OPTIONS -I${PCSC_INCLUDE_DIRS}
+        COMPILE_OPTIONS -I${PCSC_INCLUDE_DIRS} "-fno-lto"
         MOCKS RAND_bytes
         LINK_LIBRARIES ${LIBRARIES})
 
       add_mocked_test(scp02Test
         SOURCES scp02Test.c testUtil.c ${SOURCES}
+        COMPILE_OPTIONS -I${PCSC_INCLUDE_DIRS} "-fno-lto"
         MOCKS RAND_bytes
         LINK_LIBRARIES ${LIBRARIES})
 
       add_mocked_test(scp01Test
         SOURCES scp01Test.c testUtil.c ${SOURCES}
+        COMPILE_OPTIONS -I${PCSC_INCLUDE_DIRS} "-fno-lto"
         MOCKS RAND_bytes
         LINK_LIBRARIES ${LIBRARIES})
     ENDIF(UNIX AND NOT APPLE)
