From 030a3ad920a04425f99c3da48f29a1c1000b9270 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Wed, 1 Jan 2025 18:35:57 +0800 Subject: [PATCH] :memo: remove -fPIC if using MSVC --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40d3f42..1cb6a3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,11 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Wshadow -Wall") -add_compile_options(-fPIC) +# MSVC does not need -fPIC +if (NOT MSVC) + add_compile_options(-fPIC) +endif() + # MSVC needs this command option to really enable utf-8 output if (MSVC) add_compile_options(/utf-8) @@ -19,9 +23,6 @@ if (APPLE) add_compile_options(-mmacosx-version-min=10.15) endif() -# generate release executables -set(CMAKE_BUILD_TYPE "Release") - # build nasal used object set(NASAL_OBJECT_SOURCE_FILE ${CMAKE_SOURCE_DIR}/src/cli/cli.cpp