-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MSVC_RUNTIME_LIBRARY
instead of setting compile flags manually
#5
base: main
Are you sure you want to change the base?
Conversation
@illnyang this is not working as intended on Windows / MSVC . Please verify and try again. The produced Windows plugin should be statically linked in Release build and should have no CRT dependencies.
Thanks! |
I didn't notice that the minimum required version throughout ida-cmake is 3.12, it needs to be bumped to 3.15 for this property to take effect. I think it's reasonable to do so, that version was released back in 2017 and |
sorry, I did not notice you updated the PR. I read quickly and saw you asked for a bump. Indeed, I tought I did that before. Ok, I pushed to 3.27 ; fair and from last year. |
please revert the last change. it is a different topic anyway. |
Can you please tell me how to cross-compile and verify (full steps)? |
I use the following find_program(LLD_LINK_PATH NAMES lld-link)
if (${LLD_LINK_PATH} STREQUAL "LLD_LINK_PATH-NOTFOUND")
message(SEND_ERROR "Unable to find lld-link")
endif ()
find_program(CLANG_C_PATH NAMES clang)
if (${CLANG_C_PATH} STREQUAL "CLANG_C_PATH-NOTFOUND")
message(SEND_ERROR "Unable to find clang")
endif ()
find_program(CLANG_CXX_PATH NAMES clang++)
if (${CLANG_CXX_PATH} STREQUAL "CLANG_CXX_PATH-NOTFOUND")
message(SEND_ERROR "Unable to find clang++")
endif ()
set(CMAKE_LINKER_TYPE LLD CACHE STRING "")
set(CMAKE_C_COMPILER "${CLANG_C_PATH}" CACHE FILEPATH "")
set(CMAKE_CXX_COMPILER "${CLANG_CXX_PATH}" CACHE FILEPATH "") I'm not sure whether I verified that it works by opening built DLL in pe-bear: |
https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
Clang's GNU driver wouldn't recognize
/MT
flag when cross-compiling for Windows, let CMake handle compile flags internally instead