From 9c9f4ed7cfe1ed7b02025095c3ae5a4bc30ed93b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 10 Jun 2015 16:51:22 +0300 Subject: /SAFESEH for the asm implementation --- CMakeLists.txt | 8 ++++++-- examples/CMakeLists.txt | 2 -- test/CMakeLists.txt | 2 -- utils/CMakeLists.txt | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 029dd51..8eb62b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,13 @@ project(libaesni C CXX ASM_MASM) file(GLOB_RECURSE ${PROJECT_NAME}_headers "include/*.h") if(AESNI_USE_ASM) - file(GLOB ${PROJECT_NAME}_sources "src/asm/*.asm" "src/*.c") + file(GLOB ${PROJECT_NAME}_c_sources "src/*.c") + file(GLOB ${PROJECT_NAME}_asm_sources "src/asm/*.asm") + set(${PROJECT_NAME}_sources ${${PROJECT_NAME}_asm_sources} ${${PROJECT_NAME}_c_sources}) + set_source_files_properties(${${PROJECT_NAME}_asm_sources} PROPERTIES COMPILE_FLAGS "/safeseh") + # Setting CMAKE_ASM_MASM_FLAGS doesn't work: http://www.cmake.org/Bug/view.php?id=14711 else() - file(GLOB ${PROJECT_NAME}_sources "src/c/*.c" "src/*.c") + file(GLOB_RECURSE ${PROJECT_NAME}_sources "src/*.c") endif() add_library(${PROJECT_NAME} ${${PROJECT_NAME}_headers} ${${PROJECT_NAME}_sources}) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8cf4d6a..d8ce968 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,3 @@ -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - macro(example prefix) add_executable(example_${prefix} ${prefix}.c) target_link_libraries(example_${prefix} libaesni) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bfbb09c..2a1cc9a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,3 @@ -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - macro(test prefix) add_executable(test_${prefix}_encrypt_block ${prefix}_encrypt_block.c) target_link_libraries(test_${prefix}_encrypt_block libaesni) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index e770857..f6ca7d1 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,5 +1,3 @@ -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - macro(util prefix) add_executable(util_${prefix} ${prefix}.cpp) target_link_libraries(util_${prefix} libaesni) -- cgit v1.2.3