From fe8141efc610dc0b70b9e75173af4089932107cb Mon Sep 17 00:00:00 2001 From: lilin Date: Sun, 7 Jan 2024 13:57:06 +0800 Subject: [PATCH 1/2] fix: fix compilation error on linux --- src/kiwi/base/files/file.h | 2 +- src/kiwi/third_party/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kiwi/base/files/file.h b/src/kiwi/base/files/file.h index f9914299..29063c3d 100644 --- a/src/kiwi/base/files/file.h +++ b/src/kiwi/base/files/file.h @@ -32,7 +32,7 @@ typedef struct stat stat_wrapper_t; } #elif BUILDFLAG(IS_POSIX) struct stat64; -namespace base { +namespace kiwi::base { typedef struct stat64 stat_wrapper_t; } #endif diff --git a/src/kiwi/third_party/CMakeLists.txt b/src/kiwi/third_party/CMakeLists.txt index 324ab24b..f7ce0e71 100644 --- a/src/kiwi/third_party/CMakeLists.txt +++ b/src/kiwi/third_party/CMakeLists.txt @@ -10,6 +10,8 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +set (CMAKE_POSITION_INDEPENDENT_CODE ON) + add_subdirectory(glog) add_subdirectory(SDL2) add_subdirectory(nes_apu) From d806aa21829581539f2410dd45661280eb8adb04 Mon Sep 17 00:00:00 2001 From: lilin Date: Sun, 7 Jan 2024 14:08:32 +0800 Subject: [PATCH 2/2] fix: fix compilation error on windows --- src/kiwi/base/files/file_enumerator_win.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kiwi/base/files/file_enumerator_win.cc b/src/kiwi/base/files/file_enumerator_win.cc index 975589a9..f7681dfe 100644 --- a/src/kiwi/base/files/file_enumerator_win.cc +++ b/src/kiwi/base/files/file_enumerator_win.cc @@ -12,6 +12,10 @@ #include "base/win/shlwapi.h" #include "base/win/windows_types.h" +#ifdef _MSC_VER +#pragma comment(lib, "Shlwapi.lib") +#endif + #if defined(max) #undef max #endif