mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[CMAKE] Allow compiling amd64 port with GCC on Windows
Dedicated to Daniel
This commit is contained in:
parent
eae3db10ae
commit
0f723105c6
|
@ -13,6 +13,9 @@ function(setup_host_tools)
|
||||||
string(STRIP ${GCC_PLUGIN_DIR} GCC_PLUGIN_DIR)
|
string(STRIP ${GCC_PLUGIN_DIR} GCC_PLUGIN_DIR)
|
||||||
list(APPEND CMAKE_HOST_TOOLS_EXTRA_ARGS -DGCC_PLUGIN_DIR=${GCC_PLUGIN_DIR})
|
list(APPEND CMAKE_HOST_TOOLS_EXTRA_ARGS -DGCC_PLUGIN_DIR=${GCC_PLUGIN_DIR})
|
||||||
list(APPEND HOST_MODULES gcc_plugin_seh)
|
list(APPEND HOST_MODULES gcc_plugin_seh)
|
||||||
|
if (CMAKE_HOST_WIN32)
|
||||||
|
list(APPEND HOST_MODULES g++_plugin_seh)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
list(TRANSFORM HOST_TOOLS PREPEND "${REACTOS_BINARY_DIR}/host-tools/bin/" OUTPUT_VARIABLE HOST_TOOLS_OUTPUT)
|
list(TRANSFORM HOST_TOOLS PREPEND "${REACTOS_BINARY_DIR}/host-tools/bin/" OUTPUT_VARIABLE HOST_TOOLS_OUTPUT)
|
||||||
if (CMAKE_HOST_WIN32)
|
if (CMAKE_HOST_WIN32)
|
||||||
|
|
|
@ -20,7 +20,13 @@ if(MSVC OR ((CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (ARCH STREQUAL "amd64")))
|
||||||
elseif((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (ARCH STREQUAL "amd64"))
|
elseif((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (ARCH STREQUAL "amd64"))
|
||||||
# for GCC amd64 this is just an interface library, with our home-made plugin
|
# for GCC amd64 this is just an interface library, with our home-made plugin
|
||||||
add_library(pseh INTERFACE)
|
add_library(pseh INTERFACE)
|
||||||
target_compile_options(pseh INTERFACE -fplugin=$<TARGET_FILE:native-gcc_plugin_seh>)
|
if (CMAKE_HOST_WIN32)
|
||||||
|
target_compile_options(pseh INTERFACE
|
||||||
|
$<$<COMPILE_LANGUAGE:C>:-fplugin=$<TARGET_FILE:native-gcc_plugin_seh>>
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-fplugin=$<TARGET_FILE:native-g++_plugin_seh>>)
|
||||||
|
else()
|
||||||
|
target_compile_options(pseh INTERFACE $<$<COMPILE_LANGUAGE:C,CXX>:-fplugin=$<TARGET_FILE:native-gcc_plugin_seh>>)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
|
|
||||||
if(USE_PSEH3)
|
if(USE_PSEH3)
|
||||||
|
|
|
@ -2,3 +2,11 @@
|
||||||
add_host_module(gcc_plugin_seh main.cpp)
|
add_host_module(gcc_plugin_seh main.cpp)
|
||||||
target_include_directories(gcc_plugin_seh PRIVATE ${GCC_PLUGIN_DIR}/include)
|
target_include_directories(gcc_plugin_seh PRIVATE ${GCC_PLUGIN_DIR}/include)
|
||||||
set_target_properties(gcc_plugin_seh PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
set_target_properties(gcc_plugin_seh PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
if (CMAKE_HOST_SYSTEM MATCHES "Windows")
|
||||||
|
# On windows, GCC plugins need to be linked to the main executable
|
||||||
|
# This means that there must be a plugin for both GCC & G++
|
||||||
|
target_link_libraries(gcc_plugin_seh PRIVATE ${GCC_PLUGIN_DIR}/cc1.exe.a)
|
||||||
|
add_host_module(g++_plugin_seh $<TARGET_OBJECTS:gcc_plugin_seh>)
|
||||||
|
target_link_libraries(g++_plugin_seh PRIVATE ${GCC_PLUGIN_DIR}/cc1plus.exe.a)
|
||||||
|
endif()
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#define is_alpha(c) (((c)>64 && (c)<91) || ((c)>96 && (c)<123))
|
#define is_alpha(c) (((c)>64 && (c)<91) || ((c)>96 && (c)<123))
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(WIN32)
|
#if defined(_WIN32) || defined(WIN32)
|
||||||
#define VISIBLE __decspec(dllexport)
|
#define VISIBLE __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define VISIBLE __attribute__((__visibility__("default")))
|
#define VISIBLE __attribute__((__visibility__("default")))
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue