diff options
author | Hiroo Ono <hiroo@oikumene.net> | 2024-09-08 02:25:00 +0900 |
---|---|---|
committer | Hiroo Ono <hiroo@oikumene.net> | 2024-09-08 02:25:00 +0900 |
commit | 17aaab3d851e533930bc7eb553caa35700b48452 (patch) | |
tree | f94e5bae3cc144ad0956f1fe4301bc79a5210ed4 | |
parent | d2b65074ac9b2b296ec72c6bf4dd546ce4666bb7 (diff) |
In the build of Collada-DOM, Check CMAKE_CXX_COMPILER_ID to set
different options according to compiler.
-rw-r--r-- | patches/collada-dom-v2.3-r7.patch | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/patches/collada-dom-v2.3-r7.patch b/patches/collada-dom-v2.3-r7.patch index e964a0c5a1..c500de957d 100644 --- a/patches/collada-dom-v2.3-r7.patch +++ b/patches/collada-dom-v2.3-r7.patch @@ -1,14 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index b1c1993..d9787be 100644 +index b1c1993..cdcba63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1,14 +1,37 @@ +@@ -1,14 +1,25 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -set(COLLADA14_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/1.4) -set(COLLADA15_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/1.5) +project(colladadom) +cmake_minimum_required(VERSION 3.17) -+cmake_policy(SET CMP0167 NEW) + +include(FindPkgConfig) + @@ -19,17 +18,6 @@ index b1c1993..d9787be 100644 + +set(COLLADA_DOM_SOVERSION "0") +set(COLLADA_DOM_VERSION "2.3") -+set(COLLADA_DOM_INCLUDE_INSTALL_DIR -+ ${CMAKE_BINARY_DIR}/packages/include/collada -+) -+set(COLLADA_DOM_LIBS_INSTALL_DIR -+ ${CMAKE_BINARY_DIR}/packages/lib -+) -+file(MAKE_DIRECTORY -+ ${COLLADA_DOM_INCLUDE_INSTALL_DIR}/1.4 -+ ${COLLADA_DOM_INCLUDE_INSTALL_DIR}/1.5 -+ ${COLLADA_DOM_LIBS_INSTALL_DIR} -+) + file(GLOB dae_files ${CMAKE_CURRENT_SOURCE_DIR}/src/dae/*.cpp) file(GLOB libxmlplugin_files ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/LIBXMLPlugin/*.cpp) @@ -45,18 +33,38 @@ index b1c1993..d9787be 100644 if( OPT_COLLADA15 ) add_subdirectory(src/1.5) +@@ -17,8 +28,8 @@ if( OPT_COLLADA14 ) + add_subdirectory(src/1.4) + endif() + +-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/1.4 DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) +-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/1.5 DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) +-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/dae DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) +-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/modules DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) +-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dae.h ${CMAKE_CURRENT_SOURCE_DIR}/include/dae.h DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR}) ++# install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/1.4 DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) ++# install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/1.5 DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) ++# install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/dae DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) ++# install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/modules DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR} PATTERN ".svn" EXCLUDE PATTERN ".~" EXCLUDE) ++# install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dae.h ${CMAKE_CURRENT_SOURCE_DIR}/include/dae.h DESTINATION ${COLLADA_DOM_INCLUDE_INSTALL_DIR}) diff --git a/src/1.4/CMakeLists.txt b/src/1.4/CMakeLists.txt -index 17fbaea..8df5462 100644 +index 17fbaea..07d341f 100644 --- a/src/1.4/CMakeLists.txt +++ b/src/1.4/CMakeLists.txt -@@ -1,10 +1,26 @@ +@@ -1,10 +1,32 @@ file(GLOB dom_files ${CMAKE_CURRENT_SOURCE_DIR}/dom/*.cpp) -include_directories(${COLLADA14_INCLUDE_DIR}) -add_library(collada14dom SHARED ${COLLADA_BASE_SOURCES} ${dom_files}) +add_library(collada14dom STATIC ${COLLADA_BASE_SOURCES} ${dom_files}) -+target_compile_options(collada14dom PRIVATE ++if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++ target_compile_options(collada14dom PRIVATE + "-Wno-error=unused-result" "-Wno-cast-user-defined" "-Wno-nonnull" -+) ++ ) ++elseif(CMAKE_CXX_COMPILER_ID STREQUAL "clang") ++ target_compile_options(collada14dom PRIVATE ++ "-Wno-error=unused-result" ++ ) ++endif() +target_include_directories(collada14dom PRIVATE + ${colladadom_SOURCE_DIR}/include + ${colladadom_SOURCE_DIR}/include/1.4 @@ -78,7 +86,7 @@ index 17fbaea..8df5462 100644 SOVERSION ${COLLADA_DOM_SOVERSION} VERSION ${COLLADA_DOM_VERSION}) -install(TARGETS collada14dom DESTINATION lib${LIB_SUFFIX}) -+install(TARGETS collada14dom DESTINATION ${COLLADA_DOM_LIBS_INSTALL_DIR}) ++# install(TARGETS collada14dom DESTINATION ${COLLADA_DOM_LIBS_INSTALL_DIR}) diff --git a/src/1.5/CMakeLists.txt b/src/1.5/CMakeLists.txt index e061a01..fb73a70 100644 --- a/src/1.5/CMakeLists.txt |