aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b31f09..2abd7bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.2)
project (libADLMIDI VERSION 1.4.1 LANGUAGES C CXX)
include(GNUInstallDirs)
-include(CheckCXXCompilerFlag)
+include(CheckCCompilerFlag)
# Prefer C90 standard
set(CMAKE_C_STANDARD 90)
@@ -69,12 +69,12 @@ if(OPENBSD_LOCALBASE)
include_directories(${OPENBSD_LOCALBASE}/include)
endif()
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- check_cxx_compiler_flag("-no-pie" HAS_NO_PIE)
+if(NOT WIN32 AND CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ check_c_compiler_flag("-no-pie" HAS_NO_PIE)
endif()
function(set_nopie _target)
- if(HAS_NO_PIE AND CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ if(NOT WIN32 AND HAS_NO_PIE AND CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS " -no-pie")
endif()
endfunction()