aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2023-09-10 17:26:30 +0200
committerJan200101 <sentrycraft123@gmail.com>2023-09-10 17:26:30 +0200
commit94841a78b8126f0ed02db3e7066f4680031011a6 (patch)
tree8f4c37e5e1eef2af7996b0fab60c5007dad54c55 /cmake
parent35f1402ad5d7f142bb3932238422188455bbb9df (diff)
downloadSouthRPC-94841a78b8126f0ed02db3e7066f4680031011a6.tar.gz
SouthRPC-94841a78b8126f0ed02db3e7066f4680031011a6.zip
streamline compiler flag checkingbase
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindNorthstarPluginABI.cmake2
-rw-r--r--cmake/R2plugin.cmake10
2 files changed, 6 insertions, 6 deletions
diff --git a/cmake/FindNorthstarPluginABI.cmake b/cmake/FindNorthstarPluginABI.cmake
index 08518f2..ff8024a 100644
--- a/cmake/FindNorthstarPluginABI.cmake
+++ b/cmake/FindNorthstarPluginABI.cmake
@@ -9,4 +9,4 @@ check_init_submodule(${NS_LAUNCHER_DIR})
set(NS_DLL_DIR "${NS_LAUNCHER_DIR}/NorthstarDLL")
set(NS_PLUG_DIR "${NS_DLL_DIR}/plugins")
-set(NorthstarPluginABI_FOUND)
+set(NorthstarPluginABI_FOUND 1)
diff --git a/cmake/R2plugin.cmake b/cmake/R2plugin.cmake
index bb9dac0..107a981 100644
--- a/cmake/R2plugin.cmake
+++ b/cmake/R2plugin.cmake
@@ -27,12 +27,12 @@ include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)
-macro(check_compiler_flags CHECK_FUNC FLAGS OUTPUT)
+macro(check_compiler_flags LANG FLAGS OUTPUT)
foreach(flag ${${FLAGS}})
string(REPLACE "+" "P" VAR_NAME ${flag})
string(TOUPPER ${VAR_NAME} VAR_NAME)
set(flag "-${flag}")
- cmake_language(CALL ${CHECK_FUNC} "${flag}" "${VAR_NAME}")
+ check_compiler_flag("${LANG}" "${flag}" "${VAR_NAME}")
if(${${VAR_NAME}})
list(APPEND ${OUTPUT} "${flag}")
@@ -79,7 +79,7 @@ list(APPEND
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
if("C" IN_LIST languages)
- check_compiler_flags(check_c_compiler_flag C_FLAGS C_FLAGS_LIST)
+ check_compiler_flags("C" C_FLAGS C_FLAGS_LIST)
list(JOIN C_FLAGS_LIST " " C_FLAGS)
set(PLUGIN_C_FLAGS "${PLUGIN_C_FLAGS} ${C_FLAGS}")
@@ -87,11 +87,11 @@ if("C" IN_LIST languages)
list(JOIN C_LINK_FLAGS_LIST " " PLUGIN_C_LINK_FLAGS)
endif()
if("CXX" IN_LIST languages)
- check_compiler_flags(check_cxx_compiler_flag CXX_FLAGS CXX_FLAGS_LIST)
+ check_compiler_flags("CXX" CXX_FLAGS CXX_FLAGS_LIST)
list(JOIN CXX_FLAGS_LIST " " CXX_FLAGS)
set(PLUGIN_CXX_FLAGS "${PLUGIN_CXX_FLAGS} ${CXX_FLAGS}")
- check_linker_flags("C" CXX_LINK_FLAGS CXX_LINK_FLAGS_LIST)
+ check_linker_flags("CXX" CXX_LINK_FLAGS CXX_LINK_FLAGS_LIST)
list(JOIN CXX_LINK_FLAGS_LIST " " PLUGIN_CXX_LINK_FLAGS)
endif()