瀏覽代碼

Use INCLUDE_DIRs for libraries. Simplify conditions

tags/v1.8.0
Jon Beniston 3 年之前
父節點
當前提交
4aca94f20f
共有 1 個文件被更改,包括 12 次插入7 次删除
  1. +12
    -7
      CMakeLists.txt

+ 12
- 7
CMakeLists.txt 查看文件

@@ -19,10 +19,14 @@ add_compile_definitions(PALETTE_DIR="../palettes")

if (PNG_FOUND AND LIBSNDFILE_FOUND)
add_executable(aptdec ${EXE_C_SOURCE_FILES})
target_link_libraries(aptdec PRIVATE libaptdec)
include_directories(${PNG_PNG_INCLUDE_DIR})
include_directories(${LIBSNDFILE_INCLUDE_DIR})
target_link_libraries(aptdec PRIVATE PNG::PNG)
target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY})
if (CLANG OR GCC)
target_link_libraries(aptdec PRIVATE libaptdec)
if (MSVC)
target_compile_options(aptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1)
else()
# Math
target_link_libraries(aptdec PRIVATE m)

@@ -32,21 +36,22 @@ if (PNG_FOUND AND LIBSNDFILE_FOUND)
else()
target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic)
endif()
elseif (MSVC)
target_compile_options(aptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1)
endif()
else()
MESSAGE(STATUS "WARNING: Only building libaptdec, as not all of the required libraries were found.")
endif()

if (CLANG OR CGCC)
if (MSVC)
target_compile_options(libaptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1)
else()
# Math
target_link_libraries(libaptdec PRIVATE m)

if(CMAKE_BUILD_TYPE MATCHES "Release")
target_compile_options(libaptdec PRIVATE -Wall -Wextra -pedantic -Wno-missing-field-initializers -Werror)
else()
target_compile_options(libaptdec PRIVATE -Wall -Wextra -pedantic)
endif()
elseif (MSVC)
target_compile_options(libaptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1)
endif()

# TODO: get this from git


Loading…
取消
儲存