From 849ad2f14e3531f0ff1b2db408dafbca8d231a2f Mon Sep 17 00:00:00 2001 From: Zack Zhiyuan Li Date: Mon, 4 Nov 2024 23:18:34 +0000 Subject: [PATCH] clean CMakeList --- CMakeLists.txt | 31 +++++++------------------------ dependency/bark.cpp | 2 +- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f86110d..9dd09762 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,39 +5,22 @@ include(ExternalProject) # Platform-specific settings if(WIN32) - # Windows-specific settings - add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX) # OpenMP is optional on Windows find_package(OpenMP QUIET) - if(NOT OpenMP_FOUND) - message(STATUS "OpenMP not found - OpenMP support will be disabled") - set(OpenMP_C_FLAGS "") - set(OpenMP_CXX_FLAGS "") - set(OpenMP_EXE_LINKER_FLAGS "") - endif() elseif(APPLE) - # macOS-specific settings find_package(OpenMP QUIET) - if(NOT OpenMP_FOUND) - message(STATUS "OpenMP not found - OpenMP support will be disabled") - set(OpenMP_C_FLAGS "") - set(OpenMP_CXX_FLAGS "") - set(OpenMP_EXE_LINKER_FLAGS "") - endif() else() # Linux and other Unix systems find_package(OpenMP REQUIRED) endif() -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_CXX_STANDARD 17) - -# Windows-specific configurations -if(WIN32) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-DNOMINMAX) - add_definitions(-D_WIN32_WINNT=0x0A00) # Target Windows 10 or later - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# Set OpenMP flags if not found (Windows/Mac) +if(NOT OpenMP_FOUND) + message(STATUS "OpenMP not found - OpenMP support will be disabled") + set(OpenMP_C_FLAGS "") + set(OpenMP_CXX_FLAGS "") + set(OpenMP_EXE_LINKER_FLAGS "") endif() # Function to collect all user-defined options diff --git a/dependency/bark.cpp b/dependency/bark.cpp index 1c228860..451a7290 160000 --- a/dependency/bark.cpp +++ b/dependency/bark.cpp @@ -1 +1 @@ -Subproject commit 1c22886058af2ff72b92624bc86f88cc11a3dfc6 +Subproject commit 451a7290c50fb41ab7113667f3c7854b4a271da2